Skip to content

Commit 66cad5b

Browse files
Update to pytorch lightning 2.0.2, remove lightning bolts dependency and other fixes (#344)
* updated lightning version, removed bolts dependency, fixed umap, updated some python syntax * remove support for 3.7 and fixed timm import * fixes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update dali_tests.yml * Update sphinx-linkcheck.yml --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6a891ee commit 66cad5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+347
-158
lines changed

.github/workflows/dali_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python: [3.7, 3.8, 3.9]
15+
python: [3.8, 3.9]
1616
os: [ubuntu-latest]
1717

1818
steps:

.github/workflows/sphinx-linkcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515

16-
- name: Set up Python 3.7
16+
- name: Set up Python 3.9
1717
uses: actions/setup-python@v1
1818
with:
19-
python-version: 3.7
19+
python-version: 3.9
2020

2121
- name: python dependencies
2222
run: |

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python: [3.7, 3.8, 3.9]
15+
python: [3.8, 3.9]
1616
os: [ubuntu-latest, windows-latest]
1717

1818
steps:

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
def package_list_from_file(file):
5353
"""List up package name (not containing version and extras) from a package list file"""
5454
mocked_packages = []
55-
with open(file, "r") as fp:
55+
with open(file) as fp:
5656
for ln in fp.readlines():
5757
# Example: `tqdm>=4.41.0` => `tqdm`
5858
# `[` is for package with extras

docs/source/solo/methods/base.rst

Lines changed: 4 additions & 4 deletions

docs/source/solo/methods/linear.rst

Lines changed: 2 additions & 2 deletions

main_umap.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import os
2222
from pathlib import Path
2323

24+
from omegaconf import OmegaConf
25+
2426
from solo.args.umap import parse_args_umap
2527
from solo.data.classification_dataloader import prepare_data
2628
from solo.methods import METHODS
@@ -38,15 +40,14 @@ def main():
3840
# load arguments
3941
with open(args_path) as f:
4042
method_args = json.load(f)
43+
cfg = OmegaConf.create(method_args)
4144

4245
# build the model
4346
model = (
4447
METHODS[method_args["method"]]
45-
.load_from_checkpoint(ckpt_path, strict=False, **method_args)
48+
.load_from_checkpoint(ckpt_path, strict=False, cfg=cfg)
4649
.backbone
4750
)
48-
model.cuda()
49-
5051
# prepare data
5152
train_loader, val_loader = prepare_data(
5253
args.dataset,
@@ -55,7 +56,7 @@ def main():
5556
data_format=args.data_format,
5657
batch_size=args.batch_size,
5758
num_workers=args.num_workers,
58-
auto_augment=args.auto_augment,
59+
auto_augment=False,
5960
)
6061

6162
umap = OfflineUMAP()

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
torch>=1.10.0
22
torchvision>=0.11.1
33
einops
4-
pytorch-lightning>=1.7.0, <1.9.0
4+
pytorch-lightning==2.0.2
55
torchmetrics>=0.6.0, <0.12.0
6-
lightning-bolts>=0.6.0
76
tqdm
87
wandb
98
scipy

scripts/finetune/imagenet-100/mae.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ devices: [0, 1, 2, 3, 4, 5, 6, 7]
4949
sync_batchnorm: True
5050
accelerator: "gpu"
5151
strategy: "ddp"
52-
precision: 16
52+
precision: 16-mixed

scripts/finetune/imagenet/mae.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ devices: [0, 1, 2, 3, 4, 5, 6, 7]
4949
sync_batchnorm: True
5050
accelerator: "gpu"
5151
strategy: "ddp"
52-
precision: 16
52+
precision: 16-mixed

scripts/linear/imagenet-100/barlow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/byol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/deepclusterv2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/dino.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/mocov2plus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/mocov3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/mocov3_vit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/nnclr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/ressl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/simclr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/simsiam.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/swav.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/vibcreg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet-100/vicreg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet/barlow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet/byol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/linear/imagenet/mocov2plus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ devices: [0]
4242
sync_batchnorm: True
4343
accelerator: "gpu"
4444
strategy: "ddp"
45-
precision: 16
45+
precision: 16-mixed

scripts/pretrain/cifar-multicrop/swav.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ devices: [0]
5555
sync_batchnorm: True
5656
accelerator: "gpu"
5757
strategy: "ddp"
58-
precision: 16
58+
precision: 16-mixed

scripts/pretrain/cifar/barlow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ devices: [0]
5050
sync_batchnorm: True
5151
accelerator: "gpu"
5252
strategy: "ddp"
53-
precision: 16
53+
precision: 16-mixed

scripts/pretrain/cifar/byol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ devices: [0]
5353
sync_batchnorm: True
5454
accelerator: "gpu"
5555
strategy: "ddp"
56-
precision: 16
56+
precision: 16-mixed

scripts/pretrain/cifar/deepclusterv2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ devices: [0]
5353
sync_batchnorm: True
5454
accelerator: "gpu"
5555
strategy: "ddp"
56-
precision: 16
56+
precision: 16-mixed

scripts/pretrain/cifar/dino.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ devices: [0]
5353
sync_batchnorm: True
5454
accelerator: "gpu"
5555
strategy: "ddp"
56-
precision: 16
56+
precision: 16-mixed

scripts/pretrain/cifar/mae.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ devices: [0]
5353
sync_batchnorm: True
5454
accelerator: "gpu"
5555
strategy: "ddp"
56-
precision: 16
56+
precision: 16-mixed

scripts/pretrain/cifar/mocov2plus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ devices: [0]
5050
sync_batchnorm: True
5151
accelerator: "gpu"
5252
strategy: "ddp"
53-
precision: 16
53+
precision: 16-mixed

scripts/pretrain/cifar/mocov3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ devices: [0]
5454
sync_batchnorm: True
5555
accelerator: "gpu"
5656
strategy: "ddp"
57-
precision: 16
57+
precision: 16-mixed

scripts/pretrain/cifar/nnbyol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ devices: [0]
5454
sync_batchnorm: True
5555
accelerator: "gpu"
5656
strategy: "ddp"
57-
precision: 16
57+
precision: 16-mixed

scripts/pretrain/cifar/nnclr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ devices: [0]
5252
sync_batchnorm: True
5353
accelerator: "gpu"
5454
strategy: "ddp"
55-
precision: 16
55+
precision: 16-mixed

scripts/pretrain/cifar/nnsiam.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ devices: [0]
5050
sync_batchnorm: True
5151
accelerator: "gpu"
5252
strategy: "ddp"
53-
precision: 16
53+
precision: 16-mixed

scripts/pretrain/cifar/ressl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ devices: [0]
5353
sync_batchnorm: True
5454
accelerator: "gpu"
5555
strategy: "ddp"
56-
precision: 16
56+
precision: 16-mixed

scripts/pretrain/cifar/simclr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ devices: [0]
5050
sync_batchnorm: True
5151
accelerator: "gpu"
5252
strategy: "ddp"
53-
precision: 16
53+
precision: 16-mixed

scripts/pretrain/cifar/simsiam.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ devices: [0]
4747
sync_batchnorm: True
4848
accelerator: "gpu"
4949
strategy: "ddp"
50-
precision: 16
50+
precision: 16-mixed

scripts/pretrain/cifar/supcon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ devices: [0]
4646
sync_batchnorm: True
4747
accelerator: "gpu"
4848
strategy: "ddp"
49-
precision: 16
49+
precision: 16-mixed

scripts/pretrain/cifar/swav.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ devices: [0]
5454
sync_batchnorm: True
5555
accelerator: "gpu"
5656
strategy: "ddp"
57-
precision: 16
57+
precision: 16-mixed

scripts/pretrain/cifar/vibcreg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ devices: [0]
7474
sync_batchnorm: True
7575
accelerator: "gpu"
7676
strategy: "ddp"
77-
precision: 16
77+
precision: 16-mixed

scripts/pretrain/cifar/vicreg.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ devices: [0]
8080
sync_batchnorm: True
8181
accelerator: "gpu"
8282
strategy: "ddp"
83-
precision: 16
83+
precision: 16-mixed

scripts/pretrain/cifar/wmse.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ devices: [0]
7070
sync_batchnorm: True
7171
accelerator: "gpu"
7272
strategy: "ddp"
73-
precision: 16
73+
precision: 16-mixed

scripts/pretrain/custom/byol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ devices: [0, 1]
6060
sync_batchnorm: True
6161
accelerator: "gpu"
6262
strategy: "ddp"
63-
precision: 16
63+
precision: 16-mixed

scripts/pretrain/imagenet-100-multicrop/byol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ devices: [0, 1]
5353
sync_batchnorm: True
5454
accelerator: "gpu"
5555
strategy: "ddp"
56-
precision: 16
56+
precision: 16-mixed

scripts/pretrain/imagenet-100-multicrop/simclr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ devices: [0, 1]
5050
sync_batchnorm: True
5151
accelerator: "gpu"
5252
strategy: "ddp"
53-
precision: 16
53+
precision: 16-mixed

scripts/pretrain/imagenet-100-multicrop/supcon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ devices: [0, 1]
4646
sync_batchnorm: True
4747
accelerator: "gpu"
4848
strategy: "ddp"
49-
precision: 16
49+
precision: 16-mixed

scripts/pretrain/imagenet-100/barlow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ devices: [0, 1]
5050
sync_batchnorm: True
5151
accelerator: "gpu"
5252
strategy: "ddp"
53-
precision: 16
53+
precision: 16-mixed

scripts/pretrain/imagenet-100/byol.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ devices: [0, 1]
5353
sync_batchnorm: True
5454
accelerator: "gpu"
5555
strategy: "ddp"
56-
precision: 16
56+
precision: 16-mixed

scripts/pretrain/imagenet-100/deepclusterv2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ devices: [0, 1]
5555
sync_batchnorm: True
5656
accelerator: "gpu"
5757
strategy: "ddp"
58-
precision: 16
58+
precision: 16-mixed

scripts/pretrain/imagenet-100/dino.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ devices: [0, 1]
5454
sync_batchnorm: True
5555
accelerator: "gpu"
5656
strategy: "ddp"
57-
precision: 16
57+
precision: 16-mixed

0 commit comments

Comments
 (0)