Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converts DALI into a DataModule, improves it and cleans stuff a bit. #244

Merged
merged 16 commits into from
May 2, 2022
Merged
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ While the library is self-contained, it is possible to use the models outside of
---

## News
* **[May 02 2022]**: :diamond_shape_with_a_dot_inside: Wrapped Dali with a DataModule, added auto resume for linear eval and Wandb run resume.
* **[Apr 12 2022]**: :rainbow: Improved design of models and added support to train with a fraction of data.
* **[Apr 01 2022]**: :mag: Added the option to use [channel last conversion](https://pytorch.org/tutorials/intermediate/memory_format_tutorial.html#converting-existing-models) which considerably decreases training times.
* **[Feb 04 2022]**: :partying_face: Paper got accepted to JMLR.
Expand Down
2 changes: 1 addition & 1 deletion bash_files/knn/imagenet-100/knn.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_knn.py \
python3 main_knn.py \
--dataset imagenet100 \
--data_dir /datasets \
--train_dir imagenet-100/train \
Expand Down
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/barlow_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/byol_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/deepclusterv2_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /data/datasets \
Expand All @@ -19,4 +19,6 @@ python3 ../../../main_linear.py \
--name deepclusterv2-imagenet100-linear-eval \
--pretrained_feature_extractor PATH --project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/dino_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/general_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--name simclr-linear-eval \
--pretrained_feature_extractor PATH \
--project contrastive_learning \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/mocov2plus_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/nnclr_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/ressl_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/simclr_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /data/datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/simsiam_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/swav_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /data/datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/vibcreg_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet-100/vicreg_linear.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet100 \
--backbone resnet18 \
--data_dir /datasets \
Expand All @@ -20,4 +20,6 @@ python3 ../../../main_linear.py \
--pretrained_feature_extractor PATH \
--project solo-learn \
--entity unitn-mhug \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet/barlow.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet \
--backbone resnet50 \
--data_dir /data/datasets \
Expand All @@ -22,4 +22,6 @@ python3 ../../../main_linear.py \
--name barlow-resnet50-imagenet-linear-eval \
--entity unitn-mhug \
--project solo-learn \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
6 changes: 4 additions & 2 deletions bash_files/linear/imagenet/byol.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_linear.py \
python3 main_linear.py \
--dataset imagenet \
--backbone resnet50 \
--data_dir /data/datasets \
Expand All @@ -22,4 +22,6 @@ python3 ../../../main_linear.py \
--name byol-resnet50-imagenet-linear-eval \
--entity unitn-mhug \
--project solo-learn \
--wandb
--wandb \
--save_checkpoint \
--auto_resume
3 changes: 2 additions & 1 deletion bash_files/linear/imagenet/mocov2plus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ python3 main_linear.py \
--project solo-learn \
--entity unitn-mhug \
--wandb \
--save_checkpoint
--save_checkpoint \
--auto_resume
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/barlow.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -29,6 +29,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method barlow_twins \
--proj_hidden_dim 2048 \
--proj_output_dim 2048 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/byol.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -30,6 +30,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method byol \
--proj_output_dim 256 \
--proj_hidden_dim 4096 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/deepclusterv2.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -31,6 +31,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method deepclusterv2 \
--proj_hidden_dim 2048 \
--proj_output_dim 128 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/dino.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -31,6 +31,7 @@ python3 ../../main_pretrain.py \
--project solo-learn \
--wandb \
--save_checkpoint \
--auto_resume \
--method dino \
--proj_output_dim 256 \
--proj_hidden_dim 2048 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/mocov2plus.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand All @@ -25,6 +25,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method mocov2plus \
--proj_hidden_dim 2048 \
--queue_size 32768 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/nnbyol.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -30,6 +30,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method nnbyol \
--proj_output_dim 256 \
--proj_hidden_dim 4096 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/nnclr.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -30,6 +30,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method nnclr \
--temperature 0.2 \
--proj_hidden_dim 2048 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/nnsiam.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -26,6 +26,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method nnsiam \
--proj_hidden_dim 2048 \
--pred_hidden_dim 4096 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/ressl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -26,6 +26,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method ressl \
--proj_output_dim 256 \
--proj_hidden_dim 4096 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/simclr.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -30,6 +30,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method simclr \
--temperature 0.2 \
--proj_hidden_dim 2048 \
Expand Down
3 changes: 2 additions & 1 deletion bash_files/pretrain/cifar/simsiam.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python3 ../../../main_pretrain.py \
python3 main_pretrain.py \
--dataset $1 \
--backbone resnet18 \
--data_dir ./datasets \
Expand Down Expand Up @@ -27,6 +27,7 @@ python3 ../../../main_pretrain.py \
--entity unitn-mhug \
--wandb \
--save_checkpoint \
--auto_resume \
--method simsiam \
--proj_hidden_dim 2048 \
--pred_hidden_dim 512 \
Expand Down
Loading