Coder Social home page Coder Social logo

gate's Introduction

Generalization After Transfer Evaluation (GATE)

GATE is a comprehensive benchmarking suite that aims to fill a gap in the evaluation of foundation models. Typically, foundation model evaluation overlooks the diverse applicability found in real-world settings. GATE is designed for multi-modal and multi-task scenarios, stress-testing models in a variety of domains beyond their initial training.

Features

  • Facilitates the transfer of neural network trunks across different modalities, domains, and tasks, promoting robust fine-tuning for visual tasks.
  • Maximizes research signal per GPU hour through carefully selected scenarios.
  • Enables straightforward replacement of transferable trunks with minimal effort.

Installation

You can install GATE using pip:

pip install gate

To install from source, clone the repository and use the provided requirements file:

git clone https://github.com/yourusername/gate.git
cd gate
pip install -r requirements.txt
pip install -e . # for local dev editable mode
or 
pip install .

For development purposes, use the requirements_dev.txt file:

pip install -r requirements_dev.txt

Usage

Use GATE as a template for your research project

GATE can be used as a template for your research project. It provides full Hydra integration and includes boilerplate, models, datasets, trackers, and more. Note that using GATE as a template may involve a lot of overhead and time to learn, and may be complex.

Use GATE as a library

GATE can be used as a library in your Python projects. Here is a basic example:

import gate.data.image.classification.stl10 as stl
data = stl.build_stl10_dataset("train", data_dir=os.environ.get("PYTEST_DIR"))

import gate.models.classification.clip as clip
model = clip.build_clip_model("RN50x4", pretrained=True)

Use GATE as a library, as a source of experiment generation

GATE can be used as a library to generate experiments. Here is an example:

builder = gate.build_experiments(model=GATEModel(), gate_flavour="foundation")
experiments = builder.generate_experiments()
builder.run_experiments()

Project Structure

A high-level overview of the project's structure is given below:

.
├── boilerplate/
│   ├── callbacks.py
│   ├── convenience.py
│   ├── core.py
│   ├── decorators.py
│   ├── utils.py
│   └── wandb_utils.py
├── config/
│   ├── config.py
│   └── variables.py
├── data/
│   ├── few_shot/
│   ├── image/
│   ├── image_text/
│   ├── medical/
│   ├── tasks/
│   ├── transforms/
│   ├── video/
│   └── core.py
├── menu/
│   ├── configs/
│   ├── builder.py
│   ├── collector.py
│   ├── core.py
│   └── utils.py
├── metrics/
│   ├── core.py
│   ├── glossary.py
│   ├── multi_class_classification.py
│   ├── segmentation.py
│   └── vqa_eval.py
├── models/
│   ├── backbones/
│   ├── blocks/
│   ├── task_adapters/
│   └── core.py
├── orchestration/
│   ├── evaluators/
│   ├── trainers/
│   └── utils/
├── dummy_module.py
└── run.py

For a more detailed description of the individual files and directories, please refer to the comments in the respective files.

gate's People

Contributors

antreasantoniou avatar fadyrezkghattas avatar github-actions[bot] avatar kiyoon avatar srihari-humbarwadi avatar wonderingneuron avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

gate's Issues

Matrix Mismatch Error During DuoModalZeroShotModel Initialization in GATE Framework

Describe the bug
An execution error occurs when running a multi-modal learning model within the GATE framework, resulting in a shape mismatch between matrices during a linear operation. The specific error message is: RuntimeError: mat1 and mat2 shapes cannot be multiplied (2x768 and 512x2). This indicates that the tensor dimensions expected by the forward operation are incompatible.

To Reproduce

  1. Initialize the environment with certain project configurations, as enumerated by the error trace.
  2. Run the script gate/run.py while applying the given overrides related to the model and training configuration.
  3. Observe that at some point when the DuoModalZeroShotModel is being instantiated, a forward pass is attempted with a dummy batch.
  4. The process fails during this step, resulting in a RuntimeError, due to a shape mismatch between the tensors intended for matrix multiplication.
/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/bin/python gate/run.py exp_name=alpha-flickr30k-SIGLIP-P16-224-7 encoder=timm encoder.image_size=224 encoder.pretrained=True encoder.timm_model_name=vit_base_patch16_siglip_224 encoder.clip_model_name=openai/clip-vit-base-patch16 adapter=duo-modal-zero-shot-classifier dataset=flickr30k optimizer.lr=1e-05 optimizer.weight_decay=0.01 trainer=image_to_text_zero_shot_classification evaluator=image_to_text_zero_shot_classification num_workers=32 seed=7 train_batch_size=64 eval_batch_size=64 train_iters=10000 learner.evaluate_every_n_steps=500

Expected behavior
The model should instantiate correctly, and tensor shapes should align appropriately to perform matrix multiplications during the linear algebra operations within the forward pass. The model's construction should not lead to this kind of shape mismatch error.

Error Logs

/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/transformers/models/bart/modeling_bart.py:755: FutureWarning: The class `PretrainedBartModel` has been depreciated, please use `BartPreTrainedModel` instead.
  warnings.warn(
...
RuntimeError: mat1 and mat2 shapes cannot be multiplied (2x768 and 512x2)
...

Desktop (please complete the following information):

  • OS: The specific operating system on which the error occurred is not provided in the trace, but it appears to be a Unix-like system given the directory structure.
  • Python Version: 3.10
  • Framework Version: GATE environment specifics are not provided in the trace.

Additional context

  • The warning about the deprecated PretrainedBartModel could be unrelated to the core runtime error but should be addressed as part of the code maintenance.
  • The root of the error seems to be related to input dimensionality assumptions within the gate.models.task_adapters.duo_modal_zero_shot_classification.DuoModalZeroShotModel during model initialization.
  • Further investigation is needed to ensure that all input feature dimensions are processed and projected correctly to match expected sizes for linear operations.

MIoU not properly reported at ensembles

Describe the bug
MIoU is NaN in ensembles

To Reproduce

alpha-ade20k-SIGLIP-P16-224-7: accelerate launch --mixed_precision=bf16 gate/run.py exp_name=alpha-ade20k-SIGLIP-P16-224-7 encoder=timm encoder.image_size=224 encoder.pretrained=True encoder.timm_model_name=vit_base_patch16_siglip_224 encoder.clip_model_name=openai/clip-vit-base-patch16  adapter=segmentation-adapter adapter.loss_type_id=default  dataset=ade20k optimizer.lr=6e-06 optimizer.weight_decay=0.01 trainer=image_semantic_segmentation evaluator=image_semantic_segmentation num_workers=32 seed=7 train_batch_size=8 eval_batch_size=8 train_iters=10000 learner.evaluate_every_n_steps=500

Expected behavior
MIoU should be properly computed

Screenshots

/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/transformers/models/bart/modeling_bart.py:755: FutureWarning: The class `PretrainedBartModel` has been depreciated, please use `BartPreTrainedModel` instead.
  warnings.warn(
wandb: Currently logged in as: evolvingfungus (machinelearningbrewery). Use `wandb login --relogin` to force relogin
wandb: Tracking run with wandb version 0.16.0
wandb: Run data is saved locally in /disk/scratch_fast1/aantoni2/GATE/wandb/run-20231201_235449-8a10k19m
wandb: Run `wandb offline` to turn off syncing.
wandb: Syncing run clean-puddle-201
wandb: ⭐️ View project at https://wandb.ai/machinelearningbrewery/gate-dev-0-9-1
wandb: 🚀 View run at https://wandb.ai/machinelearningbrewery/gate-dev-0-9-1/runs/8a10k19m
/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/transformers/optimization.py:411: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning
  warnings.warn(

wandb: 
wandb: Run history:
wandb:                                         global_step ▁▁▁▁▂▂▂▂▂▃▃▃▃▃▃▄▄▄▄▄▅▅▅▅▅▅▆▆▆▆▆▇▇▇▇▇▇███
wandb:                                model/num_parameters ▁
wandb:    testing/ensemble_1/background_ce_loss-epoch-mean ▁▁
wandb:     testing/ensemble_1/background_ce_loss-epoch-std ▁▁
wandb:  testing/ensemble_1/background_dice_loss-epoch-mean ▁▁
wandb:   testing/ensemble_1/background_dice_loss-epoch-std ▁▁
wandb: testing/ensemble_1/background_focal_loss-epoch-mean ▁▁
wandb:  testing/ensemble_1/background_focal_loss-epoch-std ▁▁
wandb:       testing/ensemble_1/background_loss-epoch-mean ▁▁
wandb:        testing/ensemble_1/background_loss-epoch-std ▁▁
wandb:               testing/ensemble_1/ce_loss-epoch-mean ▁▁
wandb:                testing/ensemble_1/ce_loss-epoch-std ▁▁
wandb:             testing/ensemble_1/dice_loss-epoch-mean ▁▁
wandb:              testing/ensemble_1/dice_loss-epoch-std ▁▁
wandb:            testing/ensemble_1/focal_loss-epoch-mean ▁▁
wandb:             testing/ensemble_1/focal_loss-epoch-std ▁▁
wandb:                  testing/ensemble_1/loss-epoch-mean ▁▁
wandb:                   testing/ensemble_1/loss-epoch-std ▁▁
wandb:                 testing/ensemble_1/overall_accuracy ▁
wandb:    testing/ensemble_3/background_ce_loss-epoch-mean ▁▁
wandb:     testing/ensemble_3/background_ce_loss-epoch-std ▁▁
wandb:  testing/ensemble_3/background_dice_loss-epoch-mean ▁▁
wandb:   testing/ensemble_3/background_dice_loss-epoch-std ▁▁
wandb: testing/ensemble_3/background_focal_loss-epoch-mean ▁▁
wandb:  testing/ensemble_3/background_focal_loss-epoch-std ▁▁
wandb:       testing/ensemble_3/background_loss-epoch-mean ▁▁
wandb:        testing/ensemble_3/background_loss-epoch-std ▁▁
wandb:               testing/ensemble_3/ce_loss-epoch-mean ▁▁
wandb:                testing/ensemble_3/ce_loss-epoch-std ▁▁
wandb:             testing/ensemble_3/dice_loss-epoch-mean ▁▁
wandb:              testing/ensemble_3/dice_loss-epoch-std ▁▁
wandb:            testing/ensemble_3/focal_loss-epoch-mean ▁▁
wandb:             testing/ensemble_3/focal_loss-epoch-std ▁▁
wandb:                  testing/ensemble_3/loss-epoch-mean ▁▁
wandb:                   testing/ensemble_3/loss-epoch-std ▁▁
wandb:                 testing/ensemble_3/overall_accuracy ▁
wandb:                         training/background_ce_loss ▅█▂▆▂▄▂▄▁▂▁▂▂▄▅▃▄▃▂▄▅▄▇█▃▂▂▆▄▃▅▆▁▃▆▄▂▄▃▆
wandb:                       training/background_dice_loss ▄▇▂▃▄▂▂▂▄▃▂▃▄▆▂▃▃▄▂▂▃▃▂▄▂▃▂█▂▂▃▅▄▂▃▄▃▄▂▁
wandb:                      training/background_focal_loss ▅█▂▆▂▄▃▄▁▁▂▃▃▄▅▂▄▃▂▄▅▄▇█▄▁▁▅▄▄▅▆▁▃▆▄▃▄▃▆
wandb:                            training/background_loss ▅█▂▆▂▄▃▄▁▂▁▂▂▄▅▃▄▃▂▄▅▄▇█▃▂▂▆▄▃▅▆▁▃▆▄▃▄▃▆
wandb:                                 training/bprop_time █▁▁▁▁▁▁▁█▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▁▁
wandb:                                    training/ce_loss ▆▅▂▆▃▅▄▃▂▂▂▃▁▄▅▂▃▂▅▂▃▄▅▆▄▁▁▅▂█▂▅▆▅▄▃▅▄▁▆
wandb:                                  training/dice_loss ▄▇▂▃▄▂▂▂▄▃▂▃▄▆▂▃▃▅▂▂▃▃▂▄▂▃▂█▂▃▃▅▄▂▃▄▃▄▂▁
wandb:                                 training/focal_loss ▅▅▂▆▃▅▄▃▂▂▂▄▂▃▄▂▃▂▄▂▃▄▄▆▄▁▁▄▂█▂▄▅▅▃▂▅▄▁▅
wandb:                                 training/fprop_time █▂▂▁▂▂▂▂▆▁▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▁▂▂▂▂▂▂▂▂▁▂▂▂▂▂
wandb:                                       training/loss ▆▅▂▇▃▅▄▃▂▂▂▃▁▄▅▂▃▂▅▂▃▄▅▇▄▁▁▅▂█▂▅▅▅▄▃▅▄▁▆
wandb:                                         training/lr ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
wandb:            validation/background_ce_loss-epoch-mean ▁▁
wandb:             validation/background_ce_loss-epoch-std ▁▁
wandb:          validation/background_dice_loss-epoch-mean ▁▁
wandb:           validation/background_dice_loss-epoch-std ▁▁
wandb:         validation/background_focal_loss-epoch-mean ▁▁
wandb:          validation/background_focal_loss-epoch-std ▁▁
wandb:               validation/background_loss-epoch-mean ▁▁
wandb:                validation/background_loss-epoch-std ▁▁
wandb:                       validation/ce_loss-epoch-mean ▁▁
wandb:                        validation/ce_loss-epoch-std ▁▁
wandb:                     validation/dice_loss-epoch-mean ▁▁
wandb:                      validation/dice_loss-epoch-std ▁▁
wandb:                    validation/focal_loss-epoch-mean ▁▁
wandb:                     validation/focal_loss-epoch-std ▁▁
wandb:                          validation/loss-epoch-mean ▁▁
wandb:                           validation/loss-epoch-std ▁▁
wandb:                                     validation/mIoU ▁
wandb:                            validation/mean_accuracy ▁
wandb:                         validation/overall_accuracy ▁
wandb: 
wandb: Run summary:
wandb:                                         global_step 10000
wandb:                                model/num_parameters 349639319
wandb:    testing/ensemble_1/background_ce_loss-epoch-mean 1.37157
wandb:     testing/ensemble_1/background_ce_loss-epoch-std 0.18978
wandb:  testing/ensemble_1/background_dice_loss-epoch-mean 0.69328
wandb:   testing/ensemble_1/background_dice_loss-epoch-std 0.01147
wandb: testing/ensemble_1/background_focal_loss-epoch-mean 0.24148
wandb:  testing/ensemble_1/background_focal_loss-epoch-std 0.04643
wandb:       testing/ensemble_1/background_loss-epoch-mean 1.61305
wandb:        testing/ensemble_1/background_loss-epoch-std 0.23586
wandb:               testing/ensemble_1/ce_loss-epoch-mean 1.56341
wandb:                testing/ensemble_1/ce_loss-epoch-std 0.36976
wandb:             testing/ensemble_1/dice_loss-epoch-mean 0.69663
wandb:              testing/ensemble_1/dice_loss-epoch-std 0.01147
wandb:            testing/ensemble_1/focal_loss-epoch-mean 0.30386
wandb:             testing/ensemble_1/focal_loss-epoch-std 0.09362
wandb:                  testing/ensemble_1/loss-epoch-mean 2.02857
wandb:                   testing/ensemble_1/loss-epoch-std 0.4718
wandb:                             testing/ensemble_1/mIoU nan
wandb:                    testing/ensemble_1/mean_accuracy nan
wandb:                 testing/ensemble_1/overall_accuracy 0.0
wandb:    testing/ensemble_3/background_ce_loss-epoch-mean 1.39623
wandb:     testing/ensemble_3/background_ce_loss-epoch-std 0.19077
wandb:  testing/ensemble_3/background_dice_loss-epoch-mean 0.69405
wandb:   testing/ensemble_3/background_dice_loss-epoch-std 0.01155
wandb: testing/ensemble_3/background_focal_loss-epoch-mean 0.24716
wandb:  testing/ensemble_3/background_focal_loss-epoch-std 0.04706
wandb:       testing/ensemble_3/background_loss-epoch-mean 1.64339
wandb:        testing/ensemble_3/background_loss-epoch-std 0.2375
wandb:               testing/ensemble_3/ce_loss-epoch-mean 1.55858
wandb:                testing/ensemble_3/ce_loss-epoch-std 0.36999
wandb:             testing/ensemble_3/dice_loss-epoch-mean 0.69733
wandb:              testing/ensemble_3/dice_loss-epoch-std 0.01156
wandb:            testing/ensemble_3/focal_loss-epoch-mean 0.30295
wandb:             testing/ensemble_3/focal_loss-epoch-std 0.09361
wandb:                  testing/ensemble_3/loss-epoch-mean 2.02587
wandb:                   testing/ensemble_3/loss-epoch-std 0.47207
wandb:                             testing/ensemble_3/mIoU nan
wandb:                    testing/ensemble_3/mean_accuracy nan
wandb:                 testing/ensemble_3/overall_accuracy 0.0
wandb:                         training/background_ce_loss 1.02779
wandb:                       training/background_dice_loss 0.66912
wandb:                      training/background_focal_loss 0.17874
wandb:                            training/background_loss 1.20653
wandb:                                 training/bprop_time 0.03071
wandb:                                    training/ce_loss 1.43193
wandb:                                  training/dice_loss 0.67313
wandb:                                 training/focal_loss 0.25909
wandb:                                 training/fprop_time 0.11533
wandb:                                       training/loss 1.81167
wandb:                                         training/lr 0.0
wandb:            validation/background_ce_loss-epoch-mean 1.36121
wandb:             validation/background_ce_loss-epoch-std 0.19231
wandb:          validation/background_dice_loss-epoch-mean 0.69493
wandb:           validation/background_dice_loss-epoch-std 0.0138
wandb:         validation/background_focal_loss-epoch-mean 0.23839
wandb:          validation/background_focal_loss-epoch-std 0.04665
wandb:               validation/background_loss-epoch-mean 1.5996
wandb:                validation/background_loss-epoch-std 0.23863
wandb:                       validation/ce_loss-epoch-mean 1.53148
wandb:                        validation/ce_loss-epoch-std 0.37269
wandb:                     validation/dice_loss-epoch-mean 0.69829
wandb:                      validation/dice_loss-epoch-std 0.01381
wandb:                    validation/focal_loss-epoch-mean 0.29462
wandb:                     validation/focal_loss-epoch-std 0.09379
wandb:                          validation/loss-epoch-mean 1.98606
wandb:                           validation/loss-epoch-std 0.47918
wandb:                                     validation/mIoU 27.62092
wandb:                            validation/mean_accuracy 36.35272
wandb:                         validation/overall_accuracy 63.85703
wandb: 
wandb: 🚀 View run clean-puddle-201 at: https://wandb.ai/machinelearningbrewery/gate-dev-0-9-1/runs/8a10k19m
wandb: ️⚡ View job at https://wandb.ai/machinelearningbrewery/gate-dev-0-9-1/jobs/QXJ0aWZhY3RDb2xsZWN0aW9uOjEyMDA3Mjg1Ng==/version_details/v10
wandb: Synced 7 W&B file(s), 187 media file(s), 3 artifact file(s) and 1 other file(s)
wandb: Find logs at: ./wandb/run-20231201_235449-8a10k19m/logs
Exception in thread ChkStopThr:
Traceback (most recent call last):
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
Exception in thread IntMsgThr:
    self.run()
Traceback (most recent call last):
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/threading.py", line 953, in run
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
    self._target(*self._args, **self._kwargs)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/threading.py", line 953, in run
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/wandb_run.py", line 286, in check_stop_status
    self._target(*self._args, **self._kwargs)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/wandb_run.py", line 300, in check_internal_messages
    self._loop_check_status(
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/wandb_run.py", line 224, in _loop_check_status
    self._loop_check_status(
    local_handle = request()
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/wandb_run.py", line 224, in _loop_check_status
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface.py", line 750, in deliver_stop_status
    local_handle = request()
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface.py", line 766, in deliver_internal_messages
    return self._deliver_stop_status(status)
    return self._deliver_internal_messages(internal_message)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface_shared.py", line 468, in _deliver_stop_status
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface_shared.py", line 490, in _deliver_internal_messages
    return self._deliver_record(record)
    return self._deliver_record(record)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface_shared.py", line 437, in _deliver_record
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface_shared.py", line 437, in _deliver_record
    handle = mailbox._deliver_record(record, interface=self)
    handle = mailbox._deliver_record(record, interface=self)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/mailbox.py", line 455, in _deliver_record
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/mailbox.py", line 455, in _deliver_record
    interface._publish(record)
    interface._publish(record)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface_sock.py", line 51, in _publish
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/interface/interface_sock.py", line 51, in _publish
    self._sock_client.send_record_publish(record)
    self._sock_client.send_record_publish(record)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 221, in send_record_publish
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 221, in send_record_publish
    self.send_server_request(server_req)
    self.send_server_request(server_req)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 155, in send_server_request
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 155, in send_server_request
    self._send_message(msg)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 152, in _send_message
    self._send_message(msg)
    self._sendall_with_error_handle(header + data)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 152, in _send_message
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 130, in _sendall_with_error_handle
    self._sendall_with_error_handle(header + data)
  File "/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/lib/python3.10/site-packages/wandb/sdk/lib/sock_client.py", line 130, in _sendall_with_error_handle
    sent = self._sock.send(data)
BrokenPipeError: [Errno 32] Broken pipe
    sent = self._sock.send(data)
BrokenPipeError: [Errno 32] Broken pipe

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

AttributeError in DataLoader During Medical Semantic Segmentation Task

Description

An AttributeError occurred in a DataLoader worker process while executing a job within the GATE framework. This error happened during the test phase of a medical semantic segmentation task. The error details suggest that a NoneType object was encountered when the .keys() method was invoked on it, which implies an issue with data handling or collation.

Steps to Reproduce

Run the following command in the project's environment:

/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/bin/python gate/run.py exp_name=alpha-medical-decathlon-heart-SIGLIP-P16-224-7 encoder=timm encoder.image_size=224 encoder.pretrained=True encoder.timm_model_name=vit_base_patch16_siglip_224 encoder.clip_model_name=openai/clip-vit-base-patch16 adapter=segmentation-adapter adapter.loss_type_id=md dataset=medical_decathlon_heart optimizer.lr=6e-06 optimizer.weight_decay=0.01 trainer=medical_semantic_segmentation evaluator=medical_semantic_segmentation num_workers=32 seed=7 train_batch_size=1 eval_batch_size=1 train_iters=10000 learner.evaluate_every_n_steps=500

Ensure all dependencies and configurations are set up as per the project's requirements in the GATE framework.

Expected Behavior

The DataLoader is expected to generate batches of data correctly, without resulting in an AttributeError, to facilitate the testing of a semantic segmentation model on the specified medical dataset.

Error Details

AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  ...
    for key, values in zip(data[0].keys(), zip(*[d.values() for d in data])):
AttributeError: 'NoneType' object has no attribute 'keys'
Command '['/disk/scratch_fast1/aantoni2/mambaforge/envs/gate/bin/python', 'gate/run.py', ...]' returned non-zero exit status 1.

This error suggests an issue with the DataLoader's collate function or potential missing/malformed data entries.

Additional Context

This error might indicate:

  • An issue in how the DataLoader's collate function is processing the data.
  • Missing or NULL entries in the dataset which are not appropriately handled by collate_fn_with_token_pad.

Please investigate the data preparation process and how the DataLoader is configured to address the root cause of this AttributeError.

TypeError during instantiation of `DuoModalFusionModel` in 'visual_relational_reasoning_classification' module

Describe the bug
There's a TypeError in the codebase that's preventing the completion of a task. The error arises from the DuoModalFusionModel class in the 'gate.models.task_adapters.visual_relational_reasoning_classification' module, where not all arguments are being successfully converted during string formatting.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the 'gate.models.task_adapters.visual_relational_reasoning_classification' module.
  2. Instantiate a DuoModalFusionModel object.
  3. Observe the TypeError: not all arguments converted during string formatting error.

Command to Reproduce

The following command was used when the error was encountered:

accelerate-launch /app/gate/run.py exp_name=beta-clevr-math-SIGLIP-P16-224-123 encoder=timm encoder.image_size=224 encoder.pretrained=True encoder.timm_model_name=vit_base_patch16_siglip_224 encoder.clip_model_name=openai/clip-vit-base-patch16 encoder.num_projection_features=768 adapter=relational-reasoning dataset=clevr_math optimizer.lr=1e-05 optimizer.weight_decay=0.01 trainer=visual_relational_reasoning evaluator=visual_relational_reasoning num_workers=24 seed=123 train_batch_size=64 eval_batch_size=64 train_iters=10000 learner.evaluate_every_n_steps=500

Please note that the specifics of the environment where this command is run might affect the reproducibility of the error.

Expected behavior
The DuoModalFusionModel object should be successfully instantiated without any TypeError. All arguments should be correctly formatted and converted.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: [e.g. Linux]
  • Version [e.g. Python 3.10]

Additional context
The error traceback indicates that the error originated from the hydra._internal.instantiate._instantiate2.py module's _call_target function. This function, in turn, was called by the instantiate_node function in the same module. The bug might have something to do with the task adapter configuration or the way the adapter is being instantiated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.