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

fix bug for autoslim #511

Merged
merged 2 commits into from
Apr 17, 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
10 changes: 5 additions & 5 deletions configs/nas/mmcls/autoslim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ CUDA_VISIBLE_DEVICES=0 PORT=29500 ./tools/dist_test.sh \

### Subnet retrain

| Supernet | Params(M) | Flops(G) | Top-1 (%) | Top-5 (%) | Config | Download | Subnet | Remark |
| :----------------- | :-------: | -------: | :-------: | :-------: | :---------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------: |
| MobileNet v2(x1.5) | 6.5 | 0.53 | 74.23 | 91.74 | [config](./autoslim_mbv2_subnet_8xb256_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.53M_acc-74.23_20211222-e5208bbd.pth) \| [log](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1kautoslim_mbv2_subnet_8xb256_in1k_paper_channel_cfg.log.json) | [channel](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.53M_acc-74.23_20211222-e5208bbd_channel_cfg.yaml) | official channel cfg |
| MobileNet v2(x1.5) | 5.77 | 0.32 | 72.73 | 90.83 | [config](./autoslim_mbv2_subnet_8xb256_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.32M_acc-72.73_20211222-b5b0b33c.pth) \| [log](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1kautoslim_mbv2_subnet_8xb256_in1k_paper_channel_cfg.log.json) | [channel](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.32M_acc-72.73_20211222-b5b0b33c_channel_cfg.yaml) | official channel cfg |
| MobileNet v2(x1.5) | 4.13 | 0.22 | 71.39 | 90.08 | [config](./autoslim_mbv2_subnet_8xb256_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.22M_acc-71.39_20211222-43117c7b.pth) \| [log](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1kautoslim_mbv2_subnet_8xb256_in1k_paper_channel_cfg.log.json) | [channel](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.22M_acc-71.39_20211222-43117c7b_channel_cfg.yaml) | official channel cfg |
| Supernet | Params(M) | Flops(G) | Top-1 (%) | Top-5 (%) | Config | Download | Subnet | Remark |
| :----------------- | :-------: | -------: | :-------: | :-------: | :---------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------: |
| MobileNet v2(x1.5) | 6.5 | 0.53 | 74.23 | 91.74 | [config](./autoslim_mbv2_subnet_8xb256_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v1/autoslim/autoslim_mbv2_subnet_8xb256_in1k_flops-530M_acc-74.23_20220715-aa8754fe.pth) \| [log](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1kautoslim_mbv2_subnet_8xb256_in1k_paper_channel_cfg.log.json) | [channel](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.53M_acc-74.23_20211222-e5208bbd_channel_cfg.yaml) | official channel cfg |
| MobileNet v2(x1.5) | 5.77 | 0.32 | 72.73 | 90.83 | [config](./autoslim_mbv2_subnet_8xb256_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v1/autoslim/autoslim_mbv2_subnet_8xb256_in1k_flops-320M_acc-72.73_20220715-9aa8f8ae.pth) \| [log](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1kautoslim_mbv2_subnet_8xb256_in1k_paper_channel_cfg.log.json) | [channel](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.32M_acc-72.73_20211222-b5b0b33c_channel_cfg.yaml) | official channel cfg |
| MobileNet v2(x1.5) | 4.13 | 0.22 | 71.39 | 90.08 | [config](./autoslim_mbv2_subnet_8xb256_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v1/autoslim/autoslim_mbv2_subnet_8xb256_in1k_flops-220M_acc-71.4_20220715-9c288f3b.pth) \| [log](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1kautoslim_mbv2_subnet_8xb256_in1k_paper_channel_cfg.log.json) | [channel](https://download.openmmlab.com/mmrazor/v0.1/pruning/autoslim/autoslim_mbv2_subnet_8xb256_in1k/autoslim_mbv2_subnet_8xb256_in1k_flops-0.22M_acc-71.39_20211222-43117c7b_channel_cfg.yaml) | official channel cfg |

Note that we ran the official code and the Top-1 Acc of the models with official
channel cfg are 73.8%, 72.5% and 71.1%. And there are 3 differences between our
Expand Down
17 changes: 10 additions & 7 deletions configs/pruning/mmcls/dmcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ GPUS=32 sh tools/slurm_train.sh $PARTITION $JOB_NAME \

### 1.Classification

| Dataset | Supernet | Flops(M) | Top-1 (%) | Top-5 (%) | config | Download | Remark |
| :------: | :---------: | :-------------: | :-------: | :-------: | :----------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------: |
| ImageNet | ResNet50 | 4.09G(Supernet) | 77.46 | 93.55 | - | - | - |
| Dataset | Supernet | Flops(M) | Top-1 (%) | Top-5 (%) | config | Download | Remark |
| :------: | :---------: | :------------: | :-------: | :-------: | :------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------: |
| ImageNet | MobilenetV2 | 319M(Supernet) | 72.30 | 90.42 | - | - | - |
| ImageNet | MobilenetV2 | 209M(Subnet) | 71.94 | 90.05 | [config](./dmcp_mbv2_subnet_32xb64.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/200M/DMCP_MBV2_200M.pth) / [log](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/200M/dmcp_mobilenetv2_supernet_32xb64_target_flops_200m_20230129_184919.log) | [arch](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/200M/DMCP_MBV2_200M.json) |
| ImageNet | MobilenetV2 | 102M(Subnet) | 67.22 | 88.61 | [config](./dmcp_mbv2_subnet_32xb64.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/100M/DMCP_MBV2_100M.pth) / [log](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/100M/dmcp_mobilenetv2_supernet_32xb64_target_flops_100m_20230129_184919.log) | [arch\*](./DMCP_MBV2_100M.json) |

<!-- The result of Resnet50 has bugs. -->

<!-- | ImageNet | ResNet50 | 4.09G(Supernet) | 77.46 | 93.55 | - | - | - |
| ImageNet | ResNet50 | 2.07G(Subnet) | 76.11 | 93.01 | [config](./dmcp_resnet50_subnet_32xb64.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/2G/DMCP_R50_2G.pth) / [log](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/2G/dmcp_resnet50_supernet_32xb64_target_flops_2g_20230129_112944.log) | [arch\*](./DMCP_R50_2G.json) |
| ImageNet | ResNet50 | 1.05G(Subnet) | 74.12 | 92.33 | [config](./dmcp_resnet50_subnet_32xb64.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/1G/DMCP_R50_1G.pth) / [log](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/1G/dmcp_resnet50_supernet_32xb64_target_flops_1g_20230107_223552.log) | [arch](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/1G/DMCP_R50_1G.json) |
| ImageNet | MobilenetV2 | 319M(Supernet) | 72.30 | 90.42 | - | - | - |
| ImageNet | MobilenetV2 | 209M(Subnet) | 71.94 | 90.05 | [config](./dmcp_mbv2_subnet_32xb64.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/200M/DMCP_MBV2_200M.pth) / [log](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/200M/dmcp_mobilenetv2_supernet_32xb64_target_flops_200m_20230129_184919.log) | [arch](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/200M/DMCP_MBV2_200M.json) |
| ImageNet | MobilenetV2 | 102M(Subnet) | 67.22 | 88.61 | [config](./dmcp_mbv2_subnet_32xb64.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/100M/DMCP_MBV2_100M.pth) / [log](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/mobilenetv2/100M/dmcp_mobilenetv2_supernet_32xb64_target_flops_100m_20230129_184919.log) | [arch\*](./DMCP_MBV2_100M.json) |
| ImageNet | ResNet50 | 1.05G(Subnet) | 74.12 | 92.33 | [config](./dmcp_resnet50_subnet_32xb64.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/1G/DMCP_R50_1G.pth) / [log](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/1G/dmcp_resnet50_supernet_32xb64_target_flops_1g_20230107_223552.log) | [arch](https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/1G/DMCP_R50_1G.json) | -->

**Note**

Expand Down
18 changes: 9 additions & 9 deletions configs/pruning/mmcls/dmcp/metafile.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Models:
- Name: dmcp_resnet50_subnet_32xb64
In Collection: DMCP
Config: configs/pruning/mmcls/dmcp/dmcp_resnet50_subnet_32xb64.py
Weights: https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/2G/DMCP_R50_2G.pth
Results:
- Task: Image Classification
Dataset: ImageNet-1k
Metrics:
Top 1 Accuracy: 76.11
# - Name: dmcp_resnet50_subnet_32xb64
# In Collection: DMCP
# Config: configs/pruning/mmcls/dmcp/dmcp_resnet50_subnet_32xb64.py
# Weights: https://download.openmmlab.com/mmrazor/v1/pruning/dmcp/resnet50/2G/DMCP_R50_2G.pth
# Results:
# - Task: Image Classification
# Dataset: ImageNet-1k
# Metrics:
# Top 1 Accuracy: 76.11
- Name: dmcp_mbv2_subnet_32xb64
In Collection: DMCP
Config: configs/pruning/mmcls/dmcp/dmcp_mbv2_subnet_32xb64.py
Expand Down
Loading