diff --git a/configs/pruning/mmcls/dcff/README.md b/configs/pruning/mmcls/dcff/README.md index ba5692d61..e18b7599e 100644 --- a/configs/pruning/mmcls/dcff/README.md +++ b/configs/pruning/mmcls/dcff/README.md @@ -10,27 +10,27 @@ The mainstream approach for filter pruning is usually either to force a hard-cod ### 1. Classification -| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | -| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :--------------------------: | -| ImageNet | DCFFResNet50 | 15.16 | 2260 | step | 73.96 | 91.66 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | +| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| ImageNet | DCFFResNet50 | 13.32 | 2255 | step | 74.46 | 91.99 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_cls_fix_subnet_weight.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_mmcls_sup_20220906_131949.log) | ### 2. Detection -| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | -| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | +| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet_sup_20220909_103653.log) | ### 3. Segmentation -| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | -| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :--------------------------: | -| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | +| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmseg.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmpose_sup_20220908_172111.log) | ### 4. Pose -| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | -| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | +| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_pose.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_mmpose_20220908_140331.log) | ## Citation @@ -59,24 +59,20 @@ Then set layers' pruning rates `target_pruning_ratio` by `resnet_cls.json`. ### Train DCFF -#### Classification - ##### ImageNet ```bash CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 ./tools/dist_train.sh \ - configs/pruning/mmcls/dcff/dcff_resnet50_8xb32_in1k.py 4 \ + configs/pruning/mmcls/dcff/dcff_resnet_8xb32_in1k.py 4 \ --work-dir $WORK_DIR ``` ### Test DCFF -#### Classification - ##### ImageNet ```bash CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 ./tools/dist_test.sh \ configs/pruning/mmcls/dcff/dcff_compact_resnet50_8xb32_in1k.py \ - $CKPT 1 --work-dir $WORK_DIR + $WORK_DIR/fix_subnet_weight.pth 1 --work-dir $WORK_DIR ``` diff --git a/configs/pruning/mmcls/dcff/dcff_compact_resnet_8xb32_in1k.py b/configs/pruning/mmcls/dcff/dcff_compact_resnet_8xb32_in1k.py index 4a98b2584..8b40e974b 100644 --- a/configs/pruning/mmcls/dcff/dcff_compact_resnet_8xb32_in1k.py +++ b/configs/pruning/mmcls/dcff/dcff_compact_resnet_8xb32_in1k.py @@ -4,10 +4,12 @@ _base_.model = dict( _scope_='mmrazor', type='sub_model', - cfg=dict( - cfg_path='mmcls::resnet/resnet50_8xb32_in1k.py', pretrained=False), + cfg=_base_.architecture, fix_subnet='configs/pruning/mmcls/dcff/fix_subnet.json', mode='mutator', init_cfg=dict( type='Pretrained', + prefix='architecture', checkpoint='configs/pruning/mmcls/dcff/fix_subnet_weight.pth')) + +_base_.val_cfg = dict() diff --git a/configs/pruning/mmdet/dcff/README.md b/configs/pruning/mmdet/dcff/README.md index c156e19f5..44d8cf3e0 100644 --- a/configs/pruning/mmdet/dcff/README.md +++ b/configs/pruning/mmdet/dcff/README.md @@ -10,27 +10,27 @@ The mainstream approach for filter pruning is usually either to force a hard-cod ### 1. Classification -| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | -| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :--------------------------: | -| ImageNet | DCFFResNet50 | 15.16 | 2260 | step | 73.96 | 91.66 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | +| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| ImageNet | DCFFResNet50 | 13.32 | 2255 | step | 74.46 | 91.99 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_cls_fix_subnet_weight.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_mmcls_sup_20220906_131949.log) | ### 2. Detection -| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | -| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | +| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet_sup_20220909_103653.log) | ### 3. Segmentation -| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | -| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :--------------------------: | -| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | +| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmseg.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmpose_sup_20220908_172111.log) | ### 4. Pose -| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | -| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | +| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_pose.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_mmpose_20220908_140331.log) | ## Citation @@ -59,8 +59,6 @@ Then set layers' pruning rates `target_pruning_ratio` by `resnet_det.json`. ### Train DCFF -#### Detection - ##### COCO ```bash @@ -71,12 +69,10 @@ CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 ./tools/dist_train.sh \ ### Test DCFF -#### Detection - ##### COCO ```bash CUDA_VISIBLE_DEVICES=0 PORT=29500 ./tools/dist_test.sh \ configs/pruning/mmdet/dcff/dcff_compact_faster_rcnn_resnet50_8xb4_coco.py \ - $CKPT 1 --work-dir $WORK_DIR + $WORK_DIR/fix_subnet_weight.pth 1 --work-dir $WORK_DIR ``` diff --git a/configs/pruning/mmdet/dcff/dcff_compact_faster_rcnn_resnet50_8xb4_coco.py b/configs/pruning/mmdet/dcff/dcff_compact_faster_rcnn_resnet50_8xb4_coco.py index 5a2db5c11..1760f4b79 100644 --- a/configs/pruning/mmdet/dcff/dcff_compact_faster_rcnn_resnet50_8xb4_coco.py +++ b/configs/pruning/mmdet/dcff/dcff_compact_faster_rcnn_resnet50_8xb4_coco.py @@ -9,4 +9,7 @@ mode='mutator', init_cfg=dict( type='Pretrained', + prefix='architecture', checkpoint='configs/pruning/mmdet/dcff/fix_subnet_weight.pth')) + +_base_.val_cfg = dict() diff --git a/configs/pruning/mmpose/dcff/README.md b/configs/pruning/mmpose/dcff/README.md index f08efe4ff..daabab47b 100644 --- a/configs/pruning/mmpose/dcff/README.md +++ b/configs/pruning/mmpose/dcff/README.md @@ -10,27 +10,27 @@ The mainstream approach for filter pruning is usually either to force a hard-cod ### 1. Classification -| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | -| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :--------------------------: | -| ImageNet | DCFFResNet50 | 15.16 | 2260 | step | 73.96 | 91.66 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | +| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| ImageNet | DCFFResNet50 | 13.32 | 2255 | step | 74.46 | 91.99 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_cls_fix_subnet_weight.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_mmcls_sup_20220906_131949.log) | ### 2. Detection -| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | -| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | +| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet_sup_20220909_103653.log) | ### 3. Segmentation -| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | -| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :--------------------------: | -| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | +| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmseg.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmpose_sup_20220908_172111.log) | ### 4. Pose -| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | -| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | +| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_pose.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_mmpose_20220908_140331.log) | ## Citation @@ -59,8 +59,6 @@ Then set layers' pruning rates `target_pruning_ratio` by `resnet_pose.json`. ### Train DCFF -#### Pose - ##### COCO ```bash @@ -71,12 +69,10 @@ CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 ./tools/dist_train.sh \ ### Test DCFF -#### Pose - ##### COCO ```bash CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 ./tools/dist_test.sh \ configs/pruning/mmpose/dcff/dcff_compact_topdown_heatmap_resnet50.py \ - $CKPT 1 --work-dir $WORK_DIR + $WORK_DIR/fix_subnet_weight.pth 1 --work-dir $WORK_DIR ``` diff --git a/configs/pruning/mmpose/dcff/dcff_compact_topdown_heatmap_resnet50_coco.py b/configs/pruning/mmpose/dcff/dcff_compact_topdown_heatmap_resnet50_coco.py index ba5032379..439aab6b7 100644 --- a/configs/pruning/mmpose/dcff/dcff_compact_topdown_heatmap_resnet50_coco.py +++ b/configs/pruning/mmpose/dcff/dcff_compact_topdown_heatmap_resnet50_coco.py @@ -9,4 +9,7 @@ mode='mutator', init_cfg=dict( type='Pretrained', + prefix='architecture', checkpoint='configs/pruning/mmpose/dcff/fix_subnet_weight.pth')) + +_base_.val_cfg = dict() diff --git a/configs/pruning/mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py b/configs/pruning/mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py index d18bccc02..4bc0f48b8 100644 --- a/configs/pruning/mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py +++ b/configs/pruning/mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py @@ -45,8 +45,8 @@ ), head=dict( type='mmpose.HeatmapHead', - in_channels=1843, - out_channels=17, + in_channels=2048, + out_channels=24, loss=dict(type='mmpose.KeypointMSELoss', use_target_weight=True), decoder=codec), test_cfg=dict( diff --git a/configs/pruning/mmseg/dcff/README.md b/configs/pruning/mmseg/dcff/README.md index fd00eb898..984628bd1 100644 --- a/configs/pruning/mmseg/dcff/README.md +++ b/configs/pruning/mmseg/dcff/README.md @@ -10,27 +10,27 @@ The mainstream approach for filter pruning is usually either to force a hard-cod ### 1. Classification -| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | -| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :--------------------------: | -| ImageNet | DCFFResNet50 | 15.16 | 2260 | step | 73.96 | 91.66 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Backbone | Params(M) | FLOPs(M) | lr_type | Top-1 (%) | Top-5 (%) | CPrate | Config | Download | +| :------: | :----------: | :-------: | :------: | :-----: | :-------: | :-------: | :---------------------------------------------: | :--------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| ImageNet | DCFFResNet50 | 13.32 | 2255 | step | 74.46 | 91.99 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmcls/dcff/dcff_resnet_8xb32_in1k.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_cls_fix_subnet_weight.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmcls/dcff_mmcls_sup_20220906_131949.log) | ### 2. Detection -| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | -| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | Style | Lr schd | Params(M) | FLOPs(M) | bbox AP | CPrate | Config | Download | +| :-----: | :---------: | :----------: | :-----: | :-----: | :-------: | :------: | :-----: | :---------------------------------------------: | :---------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | Faster_RCNN | DCFFResNet50 | pytorch | step | 33.31 | 168320 | 35.8 | \[0.0\]+\[0.35,0.4,0.1\]\*10+\[0.3,0.3,0.1\]\*6 | [config](../../mmdet/dcff/dcff_faster_rcnn_resnet50_8xb4_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmdet/dcff_mmdet_sup_20220909_103653.log) | ### 3. Segmentation -| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | -| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :--------------------------: | -| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | Lr schd | Params(M) | FLOPs(M) | mIoU | CPrate | Config | Download | +| :--------: | :-------: | :-------------: | :-------: | :-----: | :-------: | :------: | :---: | :-----------------------------------------------------------------: | :-------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| Cityscapes | PointRend | DCFFResNetV1c50 | 512x1024 | 160k | 18.43 | 74410 | 76.75 | \[0.0, 0.0, 0.0\] + \[0.35, 0.4, 0.1\] * 10 + \[0.3, 0.3, 0.1\] * 6 | [config](../../mmseg/dcff/dcff_pointrend_resnet50_8xb2_cityscapes.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmseg.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmseg/dcff_mmpose_sup_20220908_172111.log) | ### 4. Pose -| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | -| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :--------------------------: | -| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](<>) \| \[log\] (\<>) | +| Dataset | Method | Backbone | crop size | total epochs | Params(M) | FLOPs(M) | AP | CPrate | Config | Download | +| :-----: | :-------------: | :----------: | :-------: | :----------: | :-------: | :------: | :--: | :--------------------------------------------------------: | :---------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| COCO | TopDown HeatMap | DCFFResNet50 | 256x192 | 300 | 26.95 | 4290 | 68.3 | \[0.0\] + \[0.2, 0.2, 0.1\] * 10 + \[0.15, 0.15, 0.1\] * 6 | [config](../../mmpose/dcff/dcff_topdown_heatmap_resnet50_coco.py) | [model](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_pose.pth) \\ [log](https://download.openmmlab.com/mmrazor/v1/pruning/dcff/mmpose/dcff_mmpose_20220908_140331.log) | ## Citation @@ -59,8 +59,6 @@ Then set layers' pruning rates `target_pruning_ratio` by `resnet_seg.json`. ### Train DCFF -#### Segmentation - ##### Citpscapes ```bash @@ -71,12 +69,10 @@ CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 ./tools/dist_train.sh \ ### Test DCFF -#### Segmentation - ##### Citpscapes ```bash CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=29500 ./tools/dist_test.sh \ configs/pruning/mmseg/dcff/dcff_compact_pointrend_resnet50_8xb2_cityscapes.py \ - $CKPT 1 --work-dir $WORK_DIR + $WORK_DIR/fix_subnet_weight.pth 1 --work-dir $WORK_DIR ``` diff --git a/configs/pruning/mmseg/dcff/dcff_compact_pointrend_resnet50_8xb2_cityscapes.py b/configs/pruning/mmseg/dcff/dcff_compact_pointrend_resnet50_8xb2_cityscapes.py index e6c1eb031..596d73745 100644 --- a/configs/pruning/mmseg/dcff/dcff_compact_pointrend_resnet50_8xb2_cityscapes.py +++ b/configs/pruning/mmseg/dcff/dcff_compact_pointrend_resnet50_8xb2_cityscapes.py @@ -9,4 +9,7 @@ mode='mutator', init_cfg=dict( type='Pretrained', + prefix='architecture', checkpoint='configs/pruning/mmseg/dcff/fix_subnet_weight.pth')) + +_base_.val_cfg = dict() diff --git a/mmrazor/models/task_modules/demo_inputs/mmpose_demo_input.py b/mmrazor/models/task_modules/demo_inputs/mmpose_demo_input.py index dbf5f2772..85c44939e 100644 --- a/mmrazor/models/task_modules/demo_inputs/mmpose_demo_input.py +++ b/mmrazor/models/task_modules/demo_inputs/mmpose_demo_input.py @@ -53,7 +53,6 @@ def demo_mmpose_inputs(model, for_training=False, batch_size=1): heatmap_size=model.head.decoder.heatmap_size[::-1], with_heatmap=True, with_reg_label=False)['data_samples'] - elif isinstance(model.head, SimCCHead): # bug batch_data_samples = get_packed_inputs( @@ -68,31 +67,26 @@ def demo_mmpose_inputs(model, for_training=False, batch_size=1): batch_size, num_keypoints=model.head.out_channels, )['data_samples'] - elif isinstance(model.head, DSNTHead): batch_data_samples = get_packed_inputs( batch_size, num_keypoints=model.head.num_joints, with_reg_label=True)['data_samples'] - elif isinstance(model.head, IntegralRegressionHead): batch_data_samples = get_packed_inputs( batch_size, num_keypoints=model.head.num_joints, with_reg_label=True)['data_samples'] - elif isinstance(model.head, RegressionHead): batch_data_samples = get_packed_inputs( batch_size, num_keypoints=model.head.num_joints, with_reg_label=True)['data_samples'] - elif isinstance(model.head, RLEHead): batch_data_samples = get_packed_inputs( batch_size, num_keypoints=model.head.num_joints, with_reg_label=True)['data_samples'] - elif isinstance(model.head, RTMHead): batch_data_samples = get_packed_inputs( batch_size, diff --git a/setup.py b/setup.py index 4d69ff2d4..00847ac8a 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def parse_requirements(fname='requirements.txt', with_version=True): List[str]: list of requirements items CommandLine: - python -c "import setup; print(setup.parse_requirements())" + python -c "import setup; print(setup.parse_requirements()) " """ import re import sys