Stefan Wolf commited on
Commit
20e6d37
1 Parent(s): c860968

2024 update

Browse files
.gitignore CHANGED
@@ -1,5 +1,6 @@
1
  data
2
  work_dirs
 
3
 
4
  # Created by https://www.toptal.com/developers/gitignore/api/python
5
  # Edit at https://www.toptal.com/developers/gitignore?templates=python
 
1
  data
2
  work_dirs
3
+ .conda
4
 
5
  # Created by https://www.toptal.com/developers/gitignore/api/python
6
  # Edit at https://www.toptal.com/developers/gitignore?templates=python
configs/_base_/datasets/fungi_bs16_swin_384_class-balanced.py CHANGED
@@ -62,7 +62,7 @@ train_dataloader = dict(
62
  oversample_thr=1e-2,
63
  dataset=dict(
64
  type=dataset_type,
65
- data_root='data/fungi2023/',
66
  ann_file='FungiCLEF2023_train_metadata_PRODUCTION.csv',
67
  data_prefix='DF20/',
68
  pipeline=train_pipeline)),
@@ -74,7 +74,7 @@ val_dataloader = dict(
74
  num_workers=8,
75
  dataset=dict(
76
  type=dataset_type,
77
- data_root='data/fungi2023/',
78
  ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
79
  data_prefix='DF21/',
80
  pipeline=test_pipeline),
@@ -87,7 +87,7 @@ test_dataloader = dict(
87
  num_workers=8,
88
  dataset=dict(
89
  type=dataset_type,
90
- data_root='data/fungi2023/',
91
  ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
92
  data_prefix='DF21/',
93
  pipeline=test_pipeline),
 
62
  oversample_thr=1e-2,
63
  dataset=dict(
64
  type=dataset_type,
65
+ data_root='data/fungi2024/',
66
  ann_file='FungiCLEF2023_train_metadata_PRODUCTION.csv',
67
  data_prefix='DF20/',
68
  pipeline=train_pipeline)),
 
74
  num_workers=8,
75
  dataset=dict(
76
  type=dataset_type,
77
+ data_root='data/fungi2024/',
78
  ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
79
  data_prefix='DF21/',
80
  pipeline=test_pipeline),
 
87
  num_workers=8,
88
  dataset=dict(
89
  type=dataset_type,
90
+ data_root='data/fungi2024/',
91
  ann_file='FungiCLEF2023_val_metadata_PRODUCTION.csv',
92
  data_prefix='DF21/',
93
  pipeline=test_pipeline),
configs/_base_/default_runtime.py CHANGED
@@ -31,7 +31,7 @@ env_cfg = dict(
31
  mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
32
 
33
  # set distributed parameters
34
- dist_cfg=dict(backend='nccl'),
35
  )
36
 
37
  # set visualizer
 
31
  mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
32
 
33
  # set distributed parameters
34
+ dist_cfg=dict(backend='nccl', timeout=1800),
35
  )
36
 
37
  # set visualizer
configs/fungi2023/swinv2_base_w24_b16x4-fp16_fungi+val_res_384_cb_epochs_6.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ '../_base_/models/swin_transformer_v2/base_384_aug.py', '../_base_/datasets/fungi_bs16_swin_384_class-balanced.py',
3
+ '../_base_/schedules/fungi_bs64_adamw_swin.py', '../_base_/default_runtime.py'
4
+ ]
5
+
6
+ # model settings
7
+ checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-base-w12_3rdparty_in21k-192px_20220803-f7dc9763.pth' # noqa
8
+ model = dict(
9
+ backbone=dict(
10
+ window_size=[24, 24, 24, 12],
11
+ pretrained_window_sizes=[12, 12, 12, 6],
12
+ init_cfg=dict(
13
+ type='Pretrained',
14
+ checkpoint=checkpoint,
15
+ prefix='backbone',
16
+ )),
17
+ head=dict(num_classes=1604),
18
+ train_cfg=dict(_delete_=True),
19
+ )
20
+
21
+ train_dataloader = dict(
22
+ batch_size=16,
23
+ num_workers=14)
24
+
25
+ val_dataloader = dict(
26
+ batch_size=16,
27
+ num_workers=12)
28
+
29
+ train_cfg = dict(max_epochs=6)
30
+
31
+ optim_wrapper = dict(type='AmpOptimWrapper', optimizer=dict(lr=2.5e-4 * 64 / 512))
32
+
33
+ # learning policy
34
+ param_scheduler = [
35
+ # warm up learning rate scheduler
36
+ dict(
37
+ type='LinearLR',
38
+ start_factor=0.01,
39
+ by_epoch=False,
40
+ end=4200),
41
+ # main learning rate scheduler
42
+ dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
43
+ ]
44
+
45
+ custom_imports = dict(imports=['mmpretrain_custom'], allow_failed_imports=False)
configs/fungi2023/swinv2_base_w24_b16x8-fp16_fungi+val_res_384_cb_epochs_6.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ '../_base_/models/swin_transformer_v2/base_384_aug.py', '../_base_/datasets/fungi_bs16_swin_384_class-balanced.py',
3
+ '../_base_/schedules/fungi_bs64_adamw_swin.py', '../_base_/default_runtime.py'
4
+ ]
5
+
6
+ # model settings
7
+ checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-base-w12_3rdparty_in21k-192px_20220803-f7dc9763.pth' # noqa
8
+ model = dict(
9
+ backbone=dict(
10
+ window_size=[24, 24, 24, 12],
11
+ pretrained_window_sizes=[12, 12, 12, 6],
12
+ init_cfg=dict(
13
+ type='Pretrained',
14
+ checkpoint=checkpoint,
15
+ prefix='backbone',
16
+ )),
17
+ head=dict(num_classes=1604),
18
+ train_cfg=dict(_delete_=True),
19
+ )
20
+
21
+ train_dataloader = dict(
22
+ batch_size=16,
23
+ num_workers=14)
24
+
25
+ val_dataloader = dict(
26
+ batch_size=16,
27
+ num_workers=12)
28
+
29
+ train_cfg = dict(max_epochs=6)
30
+
31
+ optim_wrapper = dict(type='AmpOptimWrapper')
32
+
33
+ # learning policy
34
+ param_scheduler = [
35
+ # warm up learning rate scheduler
36
+ dict(
37
+ type='LinearLR',
38
+ start_factor=0.01,
39
+ by_epoch=False,
40
+ end=4200),
41
+ # main learning rate scheduler
42
+ dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
43
+ ]
44
+
45
+ custom_imports = dict(imports=['mmpretrain_custom'], allow_failed_imports=False)
configs/fungi2023/swinv2_base_w24_b8x8-fp16_fungi+val_res_384_cb_epochs_6.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ '../_base_/models/swin_transformer_v2/base_384_aug.py', '../_base_/datasets/fungi_bs16_swin_384_class-balanced.py',
3
+ '../_base_/schedules/fungi_bs64_adamw_swin.py', '../_base_/default_runtime.py'
4
+ ]
5
+
6
+ # model settings
7
+ checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-base-w12_3rdparty_in21k-192px_20220803-f7dc9763.pth' # noqa
8
+ model = dict(
9
+ backbone=dict(
10
+ window_size=[24, 24, 24, 12],
11
+ pretrained_window_sizes=[12, 12, 12, 6],
12
+ init_cfg=dict(
13
+ type='Pretrained',
14
+ checkpoint=checkpoint,
15
+ prefix='backbone',
16
+ )),
17
+ head=dict(num_classes=1604),
18
+ train_cfg=dict(_delete_=True),
19
+ )
20
+
21
+ train_dataloader = dict(
22
+ batch_size=8,
23
+ num_workers=10)
24
+
25
+ val_dataloader = dict(
26
+ batch_size=16,
27
+ num_workers=10)
28
+
29
+ train_cfg = dict(max_epochs=6)
30
+
31
+ optim_wrapper = dict(type='AmpOptimWrapper', optimizer=dict(lr=2.5e-4 * 64 / 512))
32
+
33
+ # learning policy
34
+ param_scheduler = [
35
+ # warm up learning rate scheduler
36
+ dict(
37
+ type='LinearLR',
38
+ start_factor=0.01,
39
+ by_epoch=False,
40
+ end=4200),
41
+ # main learning rate scheduler
42
+ dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
43
+ ]
44
+
45
+ custom_imports = dict(imports=['mmpretrain_custom'], allow_failed_imports=False)
configs/fungi2023/swinv2_large_w24_b8x8-fp16_fungi+val_res_384_cb_epochs_6.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = [
2
+ '../_base_/models/swin_transformer_v2/large_384_aug.py', '../_base_/datasets/fungi_bs16_swin_384_class-balanced.py',
3
+ '../_base_/schedules/fungi_bs64_adamw_swin.py', '../_base_/default_runtime.py'
4
+ ]
5
+
6
+ # model settings
7
+ checkpoint = 'https://download.openmmlab.com/mmclassification/v0/swin-v2/pretrain/swinv2-large-w12_3rdparty_in21k-192px_20220803-d9073fee.pth' # noqa
8
+ model = dict(
9
+ backbone=dict(
10
+ window_size=[24, 24, 24, 12],
11
+ pretrained_window_sizes=[12, 12, 12, 6],
12
+ init_cfg=dict(
13
+ type='Pretrained',
14
+ checkpoint=checkpoint,
15
+ prefix='backbone',
16
+ )),
17
+ head=dict(num_classes=1604),
18
+ train_cfg=dict(_delete_=True),
19
+ )
20
+
21
+ train_dataloader = dict(
22
+ batch_size=8,
23
+ num_workers=10)
24
+
25
+ val_dataloader = dict(
26
+ batch_size=32,
27
+ num_workers=10)
28
+
29
+ train_cfg = dict(max_epochs=6)
30
+
31
+ optim_wrapper = dict(type='AmpOptimWrapper', optimizer=dict(lr=2.5e-4 * 64 / 512))
32
+
33
+ # learning policy
34
+ param_scheduler = [
35
+ # warm up learning rate scheduler
36
+ dict(
37
+ type='LinearLR',
38
+ start_factor=0.01,
39
+ by_epoch=False,
40
+ end=4200),
41
+ # main learning rate scheduler
42
+ dict(type='CosineAnnealingLR', eta_min=0, by_epoch=False, begin=4200)
43
+ ]
44
+
45
+ custom_imports = dict(imports=['mmpretrain_custom'], allow_failed_imports=False)
launch.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ #nvidia-smi
4
+ #echo CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES
5
+ unset CUDA_VISIBLE_DEVICES
6
+ export KMP_AFFINITY=none
7
+ python -u tools/train.py configs/fungi2023/swinv2_base_w24_b8x8-fp16_fungi+val_res_384_cb_epochs_6.py --launcher="slurm" # --auto-scale-lr
train.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ conda activate .conda/
4
+
5
+ set -x
6
+ bash tools/dist_train.sh configs/fungi2023/swinv2_base_w24_b16x4-fp16_fungi+val_res_384_cb_epochs_6.py 4
train_distributed.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ conda activate .conda/
4
+
5
+ set -x
6
+ export SRUN_CPUS_PER_TASK=${SLURM_CPUS_PER_TASK}
7
+ PYTHONPATH="$(dirname $0)":$PYTHONPATH srun --kill-on-bad-exit=1 launch.sh