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

[Feature] add training recipe and trained weights of repvgg_a0 #579

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 9 additions & 8 deletions configs/repvgg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ Our reproduced model performance on ImageNet-1K is reported as follows.

<div align="center">

| Model | Context | Top-1 (%) | Top-5 (%) | Params (M) | Recipe | Download |
|-----------|-----------|-----------|-----------|------------|------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| repvgg_a1 | D910x8-G | 74.19 | 91.89 | 14.12 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a1_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a1-539513ac.ckpt) |
| repvgg_a2 | D910x8-G | 76.63 | 93.42 | 28.25 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a2_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a2-cdc90b11.ckpt) |
| repvgg_b0 | D910x8-G | 74.99 | 92.40 | 15.85 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b0_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b0-54d5862c.ckpt) |
| repvgg_b1 | D910x8-G | 78.81 | 94.37 | 57.48 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b1_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b1-4673797.ckpt) |
| repvgg_b2 | D910x64-G | 79.29 | 94.66 | 89.11 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b2_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b2-7c91ccd4.ckpt) |
| repvgg_b3 | D910x64-G | 80.46 | 95.34 | 123.19 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b3_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b3-30b35f52.ckpt) |
| Model | Context | Top-1 (%) | Top-5 (%) | Params (M) | Recipe | Download |
|-----------|-----------|-----------|-----------|------------|------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| repvgg_a0 | D910x8-G | 72.19 | 90.75 | 9.13 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a0_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a0-6e71139d.ckpt) |
| repvgg_a1 | D910x8-G | 74.19 | 91.89 | 14.12 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a1_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a1-539513ac.ckpt) |
| repvgg_a2 | D910x8-G | 76.63 | 93.42 | 28.25 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_a2_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a2-cdc90b11.ckpt) |
| repvgg_b0 | D910x8-G | 74.99 | 92.40 | 15.85 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b0_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b0-54d5862c.ckpt) |
| repvgg_b1 | D910x8-G | 78.81 | 94.37 | 57.48 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b1_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b1-4673797.ckpt) |
| repvgg_b2 | D910x64-G | 79.29 | 94.66 | 89.11 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b2_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b2-7c91ccd4.ckpt) |
| repvgg_b3 | D910x64-G | 80.46 | 95.34 | 123.19 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/repvgg/repvgg_b3_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b3-30b35f52.ckpt) |

</div>

Expand Down
52 changes: 52 additions & 0 deletions configs/repvgg/repvgg_a0_ascend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# system
mode: 0
distribute: True
num_parallel_workers: 8
val_while_train: True

# dataset
dataset: "imagenet"
data_dir: "/path/to/imagenet"
shuffle: True
dataset_download: False
batch_size: 32
drop_remainder: True

# augmentation
image_resize: 224
scale: [0.08, 1.0]
ratio: [0.75, 1.333]
hflip: 0.5
interpolation: "bicubic"
crop_pct: 0.875

# model
model: "repvgg_a0"
num_classes: 1000
pretrained: False
ckpt_path: ""
keep_checkpoint_max: 10
ckpt_save_dir: "./ckpt"
epoch_size: 400
dataset_sink_mode: True
amp_level: "O0"

# loss
loss: "CE"
label_smoothing: 0.1

# lr scheduler
scheduler: "cosine_decay"
lr: 0.05
warmup_epochs: 10
decay_epochs: 390

# optimizer
opt: "momentum"
filter_bias_and_bn: True
momentum: 0.9
weight_decay: 0.0001
loss_scale_type: "dynamic"
drop_overflow_update: True
use_nesterov: False
eps: 0.00000001
4 changes: 2 additions & 2 deletions mindcv/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
__all__.extend(mobilenet_v2.__all__)
__all__.extend(mobilenet_v3.__all__)
__all__.extend(model_factory.__all__)
__all__.extend(["NASNetAMobile", "nasnet"])
__all__.extend(nasnet.__all__)
__all__.extend(pit.__all__)
__all__.extend(["Pnasnet", "pnasnet"])
__all__.extend(poolformer.__all__)
Expand All @@ -136,7 +136,7 @@
__all__.extend(registry.__all__)
__all__.extend(regnet.__all__)
__all__.extend(repmlp.__all__)
__all__.extend(["RepVGG", "repvgg"])
__all__.extend(repvgg.__all__)
__all__.extend(res2net.__all__)
__all__.extend(resnest.__all__)
__all__.extend(resnet.__all__)
Expand Down
2 changes: 1 addition & 1 deletion mindcv/models/repvgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _cfg(url="", **kwargs):


default_cfgs = {
"repvgg_a0": _cfg(url=""),
"repvgg_a0": _cfg(url="https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a0-6e71139d.ckpt"),
"repvgg_a1": _cfg(url="https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a1-539513ac.ckpt"),
"repvgg_a2": _cfg(url="https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_a2-cdc90b11.ckpt"),
"repvgg_b0": _cfg(url="https://download.mindspore.cn/toolkits/mindcv/repvgg/repvgg_b0-54d5862c.ckpt"),
Expand Down