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

[Improvement] Rename config files according to the config name standard. #508

Merged
merged 8 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .dev_scripts/benchmark_regression/bench_train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Models:
Top 1 Accuracy: 73.85
Top 5 Accuracy: 91.53
Weights: https://download.openmmlab.com/mmclassification/v0/resnet/resnet34_batch256_imagenet_20200708-32ffb4f7.pth
Config: configs/resnet/resnet34_b32x8_imagenet.py
Config: configs/resnet/resnet34_8xb32_in1k.py
Gpus: 8

- Name: vgg11bn
Expand All @@ -16,7 +16,7 @@ Models:
Top 1 Accuracy: 70.75
Top 5 Accuracy: 90.12
Weights: https://download.openmmlab.com/mmclassification/v0/vgg/vgg11_bn_batch256_imagenet_20210207-f244902c.pth
Config: configs/vgg/vgg11bn_b32x8_imagenet.py
Config: configs/vgg/vgg11bn_8xb32_in1k.py
Gpus: 8

- Name: seresnet50
Expand All @@ -26,7 +26,7 @@ Models:
Top 1 Accuracy: 77.74
Top 5 Accuracy: 93.84
Weights: https://download.openmmlab.com/mmclassification/v0/se-resnet/se-resnet50_batch256_imagenet_20200804-ae206104.pth
Config: configs/seresnet/seresnet50_b32x8_imagenet.py
Config: configs/seresnet/seresnet50_8xb32_in1k.py
Gpus: 8

- Name: resnext50
Expand All @@ -36,7 +36,7 @@ Models:
Top 1 Accuracy: 77.92
Top 5 Accuracy: 93.74
Weights: https://download.openmmlab.com/mmclassification/v0/resnext/resnext50_32x4d_batch256_imagenet_20200708-c07adbb7.pth
Config: configs/resnext/resnext50_32x4d_b32x8_imagenet.py
Config: configs/resnext/resnext50-32x4d_8xb32_in1k.py
Gpus: 8

- Name: mobilenet
Expand All @@ -46,7 +46,7 @@ Models:
Top 1 Accuracy: 71.86
Top 5 Accuracy: 90.42
Weights: https://download.openmmlab.com/mmclassification/v0/mobilenet_v2/mobilenet_v2_batch256_imagenet_20200708-3b2dc3af.pth
Config: configs/mobilenet_v2/mobilenet_v2_b32x8_imagenet.py
Config: configs/mobilenet_v2/mobilenet-v2_8xb32_in1k.py
Gpus: 8
Months:
- 1
Expand All @@ -61,7 +61,7 @@ Models:
Top 1 Accuracy: 68.13
Top 5 Accuracy: 87.81
Weights: https://download.openmmlab.com/mmclassification/v0/shufflenet_v1/shufflenet_v1_batch1024_imagenet_20200804-5d6cec73.pth
Config: configs/shufflenet_v1/shufflenet_v1_1x_b64x16_linearlr_bn_nowd_imagenet.py
Config: configs/shufflenet_v1/shufflenet-v1-1x_16xb64_in1k.py
Gpus: 16
Months:
- 2
Expand All @@ -76,7 +76,7 @@ Models:
Top 1 Accuracy: 81.18
Top 5 Accuracy: 95.61
Weights: https://download.openmmlab.com/mmclassification/v0/swin-transformer/swin_tiny_224_b16x64_300e_imagenet_20210616_090925-66df6be6.pth
Config: configs/swin_transformer/swin_tiny_224_b16x64_300e_imagenet.py
Config: configs/swin_transformer/swin-tiny_16xb64_in1k.py
Gpus: 16
Months:
- 3
Expand Down
2 changes: 1 addition & 1 deletion configs/fp16/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

| Model | Params(M) | Flops(G) | Mem (GB) | Top-1 (%) | Top-5 (%) | Config | Download |
|:---------------------:|:---------:|:--------:|:---------:|:---------:|:---------:| :---------:|:--------:|
| ResNet-50 | 25.56 | 4.12 | 1.9 |76.30 | 93.07 | [config](https://github.com/open-mmlab/mmclassification/blob/master/configs/fp16/resnet50_b32x8_fp16_imagenet.py) | [model](https://download.openmmlab.com/mmclassification/v0/fp16/resnet50_batch256_fp16_imagenet_20210320-b3964210.pth) | [log](https://download.openmmlab.com/mmclassification/v0/fp16/resnet50_batch256_fp16_imagenet_20210320-b3964210.log.json) |
| ResNet-50 | 25.56 | 4.12 | 1.9 |76.30 | 93.07 | [config](https://github.com/open-mmlab/mmclassification/blob/master/configs/fp16/resnet50_8xb32-fp16_in1k.py) | [model](https://download.openmmlab.com/mmclassification/v0/fp16/resnet50_batch256_fp16_imagenet_20210320-b3964210.pth) | [log](https://download.openmmlab.com/mmclassification/v0/fp16/resnet50_batch256_fp16_imagenet_20210320-b3964210.log.json) |
2 changes: 1 addition & 1 deletion configs/fp16/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ Models:
Top 1 Accuracy: 76.30
Top 5 Accuracy: 93.07
Weights: https://download.openmmlab.com/mmclassification/v0/fp16/resnet50_batch256_fp16_imagenet_20210320-b3964210.pth
Config: configs/fp16/resnet50_b32x8_fp16_dynamic_imagenet.py
Config: configs/fp16/resnet50_8xb32-fp16-dynamic_in1k.py
4 changes: 4 additions & 0 deletions configs/fp16/resnet50_8xb32-fp16-dynamic_in1k.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_base_ = ['../resnet/resnet50_8xb32_in1k.py']

# fp16 settings
fp16 = dict(loss_scale='dynamic')
4 changes: 4 additions & 0 deletions configs/fp16/resnet50_8xb32-fp16_in1k.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_base_ = ['../resnet/resnet50_8xb32_in1k.py']

# fp16 settings
fp16 = dict(loss_scale=512.)
8 changes: 5 additions & 3 deletions configs/fp16/resnet50_b32x8_fp16_dynamic_imagenet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
_base_ = ['../resnet/resnet50_b32x8_imagenet.py']
_base_ = 'resnet50_8xb32-fp16-dynamic_in1k.py'

# fp16 settings
fp16 = dict(loss_scale='dynamic')
_deprecation_ = dict(
expected='resnet50_8xb32-fp16-dynamic_in1k.py',
reference='https://github.com/open-mmlab/mmclassification/pull/508',
)
8 changes: 5 additions & 3 deletions configs/fp16/resnet50_b32x8_fp16_imagenet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
_base_ = ['../resnet/resnet50_b32x8_imagenet.py']
_base_ = 'resnet50_8xb32-fp16_in1k.py'

# fp16 settings
fp16 = dict(loss_scale=512.)
_deprecation_ = dict(
expected='resnet50_8xb32-fp16_in1k.py',
reference='https://github.com/open-mmlab/mmclassification/pull/508',
)
2 changes: 1 addition & 1 deletion configs/mobilenet_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

| Model | Params(M) | Flops(G) | Top-1 (%) | Top-5 (%) | Config | Download |
|:---------------------:|:---------:|:--------:|:---------:|:---------:|:---------:|:--------:|
| MobileNet V2 | 3.5 | 0.319 | 71.86 | 90.42 | [config](https://github.com/open-mmlab/mmclassification/blob/master/configs/mobilenet_v2/mobilenet_v2_b32x8_imagenet.py) | [model](https://download.openmmlab.com/mmclassification/v0/mobilenet_v2/mobilenet_v2_batch256_imagenet_20200708-3b2dc3af.pth) | [log](https://download.openmmlab.com/mmclassification/v0/mobilenet_v2/mobilenet_v2_batch256_imagenet_20200708-3b2dc3af.log.json) |
| MobileNet V2 | 3.5 | 0.319 | 71.86 | 90.42 | [config](https://github.com/open-mmlab/mmclassification/blob/master/configs/mobilenet_v2/mobilenet-v2_8xb32_in1k.py) | [model](https://download.openmmlab.com/mmclassification/v0/mobilenet_v2/mobilenet_v2_batch256_imagenet_20200708-3b2dc3af.pth) | [log](https://download.openmmlab.com/mmclassification/v0/mobilenet_v2/mobilenet_v2_batch256_imagenet_20200708-3b2dc3af.log.json) |
2 changes: 1 addition & 1 deletion configs/mobilenet_v2/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Models:
Top 5 Accuracy: 90.42
Task: Image Classification
Weights: https://download.openmmlab.com/mmclassification/v0/mobilenet_v2/mobilenet_v2_batch256_imagenet_20200708-3b2dc3af.pth
Config: configs/mobilenet_v2/mobilenet_v2_b32x8_imagenet.py
Config: configs/mobilenet_v2/mobilenet-v2_8xb32_in1k.py
6 changes: 6 additions & 0 deletions configs/mobilenet_v2/mobilenet-v2_8xb32_in1k.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
_base_ = [
'../_base_/models/mobilenet_v2_1x.py',
'../_base_/datasets/imagenet_bs32_pil_resize.py',
'../_base_/schedules/imagenet_bs256_epochstep.py',
'../_base_/default_runtime.py'
]
12 changes: 6 additions & 6 deletions configs/mobilenet_v2/mobilenet_v2_b32x8_imagenet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_base_ = [
'../_base_/models/mobilenet_v2_1x.py',
'../_base_/datasets/imagenet_bs32_pil_resize.py',
'../_base_/schedules/imagenet_bs256_epochstep.py',
'../_base_/default_runtime.py'
]
_base_ = 'mobilenet-v2_8xb32_in1k.py'

_deprecation_ = dict(
expected='mobilenet-v2_8xb32_in1k.py',
reference='https://github.com/open-mmlab/mmclassification/pull/508',
)
4 changes: 2 additions & 2 deletions configs/mobilenet_v3/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Models:
Top 5 Accuracy: 87.41
Task: Image Classification
Weights: https://download.openmmlab.com/mmclassification/v0/mobilenet_v3/convert/mobilenet_v3_small-8427ecf0.pth
Config: configs/mobilenet_v3/mobilenet_v3_small_imagenet.py
Config: configs/mobilenet_v3/mobilenet-v3-small_8xb32_in1k.py
- Name: mobilenet_v3_large_imagenet
Metadata:
FLOPs: 230000000
Expand All @@ -39,4 +39,4 @@ Models:
Top 5 Accuracy: 91.34
Task: Image Classification
Weights: https://download.openmmlab.com/mmclassification/v0/mobilenet_v3/convert/mobilenet_v3_large-3ea3c186.pth
Config: configs/mobilenet_v3/mobilenet_v3_large_imagenet.py
Config: configs/mobilenet_v3/mobilenet-v3-large_8xb32_in1k.py
158 changes: 158 additions & 0 deletions configs/mobilenet_v3/mobilenet-v3-large_8xb32_in1k.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Refer to https://pytorch.org/blog/ml-models-torchvision-v0.9/#classification
# ----------------------------
# -[x] auto_augment='imagenet'
# -[x] batch_size=128 (per gpu)
# -[x] epochs=600
# -[x] opt='rmsprop'
# -[x] lr=0.064
# -[x] eps=0.0316
# -[x] alpha=0.9
# -[x] weight_decay=1e-05
# -[x] momentum=0.9
# -[x] lr_gamma=0.973
# -[x] lr_step_size=2
# -[x] nproc_per_node=8
# -[x] random_erase=0.2
# -[x] workers=16 (workers_per_gpu)
# - modify: RandomErasing use RE-M instead of RE-0

_base_ = [
'../_base_/models/mobilenet-v3-large_8xb32_in1k.py',
'../_base_/datasets/imagenet_bs32_pil_resize.py',
'../_base_/default_runtime.py'
]

img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)

policies = [
[
dict(type='Posterize', bits=4, prob=0.4),
dict(type='Rotate', angle=30., prob=0.6)
],
[
dict(type='Solarize', thr=256 / 9 * 4, prob=0.6),
dict(type='AutoContrast', prob=0.6)
],
[dict(type='Equalize', prob=0.8),
dict(type='Equalize', prob=0.6)],
[
dict(type='Posterize', bits=5, prob=0.6),
dict(type='Posterize', bits=5, prob=0.6)
],
[
dict(type='Equalize', prob=0.4),
dict(type='Solarize', thr=256 / 9 * 5, prob=0.2)
],
[
dict(type='Equalize', prob=0.4),
dict(type='Rotate', angle=30 / 9 * 8, prob=0.8)
],
[
dict(type='Solarize', thr=256 / 9 * 6, prob=0.6),
dict(type='Equalize', prob=0.6)
],
[dict(type='Posterize', bits=6, prob=0.8),
dict(type='Equalize', prob=1.)],
[
dict(type='Rotate', angle=10., prob=0.2),
dict(type='Solarize', thr=256 / 9, prob=0.6)
],
[
dict(type='Equalize', prob=0.6),
dict(type='Posterize', bits=5, prob=0.4)
],
[
dict(type='Rotate', angle=30 / 9 * 8, prob=0.8),
dict(type='ColorTransform', magnitude=0., prob=0.4)
],
[
dict(type='Rotate', angle=30., prob=0.4),
dict(type='Equalize', prob=0.6)
],
[dict(type='Equalize', prob=0.0),
dict(type='Equalize', prob=0.8)],
[dict(type='Invert', prob=0.6),
dict(type='Equalize', prob=1.)],
[
dict(type='ColorTransform', magnitude=0.4, prob=0.6),
dict(type='Contrast', magnitude=0.8, prob=1.)
],
[
dict(type='Rotate', angle=30 / 9 * 8, prob=0.8),
dict(type='ColorTransform', magnitude=0.2, prob=1.)
],
[
dict(type='ColorTransform', magnitude=0.8, prob=0.8),
dict(type='Solarize', thr=256 / 9 * 2, prob=0.8)
],
[
dict(type='Sharpness', magnitude=0.7, prob=0.4),
dict(type='Invert', prob=0.6)
],
[
dict(
type='Shear',
magnitude=0.3 / 9 * 5,
prob=0.6,
direction='horizontal'),
dict(type='Equalize', prob=1.)
],
[
dict(type='ColorTransform', magnitude=0., prob=0.4),
dict(type='Equalize', prob=0.6)
],
[
dict(type='Equalize', prob=0.4),
dict(type='Solarize', thr=256 / 9 * 5, prob=0.2)
],
[
dict(type='Solarize', thr=256 / 9 * 4, prob=0.6),
dict(type='AutoContrast', prob=0.6)
],
[dict(type='Invert', prob=0.6),
dict(type='Equalize', prob=1.)],
[
dict(type='ColorTransform', magnitude=0.4, prob=0.6),
dict(type='Contrast', magnitude=0.8, prob=1.)
],
[dict(type='Equalize', prob=0.8),
dict(type='Equalize', prob=0.6)],
]

train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='RandomResizedCrop', size=224, backend='pillow'),
dict(type='RandomFlip', flip_prob=0.5, direction='horizontal'),
dict(type='AutoAugment', policies=policies),
dict(
type='RandomErasing',
erase_prob=0.2,
mode='const',
min_area_ratio=0.02,
max_area_ratio=1 / 3,
fill_color=img_norm_cfg['mean']),
dict(type='Normalize', **img_norm_cfg),
dict(type='ImageToTensor', keys=['img']),
dict(type='ToTensor', keys=['gt_label']),
dict(type='Collect', keys=['img', 'gt_label'])
]

data = dict(
samples_per_gpu=128,
workers_per_gpu=4,
train=dict(pipeline=train_pipeline))
evaluation = dict(interval=10, metric='accuracy')

# optimizer
optimizer = dict(
type='RMSprop',
lr=0.064,
alpha=0.9,
momentum=0.9,
eps=0.0316,
weight_decay=1e-5)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(policy='step', step=2, gamma=0.973, by_epoch=True)
runner = dict(type='EpochBasedRunner', max_epochs=600)
8 changes: 8 additions & 0 deletions configs/mobilenet_v3/mobilenet-v3-small_8xb16_cifar10.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_base_ = [
'../_base_/models/mobilenet-v3-small_8xb16_cifar.py',
'../_base_/datasets/cifar10_bs16.py',
'../_base_/schedules/cifar10_bs128.py', '../_base_/default_runtime.py'
]

lr_config = dict(policy='step', step=[120, 170])
runner = dict(type='EpochBasedRunner', max_epochs=200)
Loading