From 2ff3e32e3b896d39001197f20261aa38c4a7ec94 Mon Sep 17 00:00:00 2001 From: lzyhha <819814373@qq.com> Date: Fri, 23 Dec 2022 01:23:29 +0800 Subject: [PATCH] fix link --- configs/rfnext/README.md | 42 +++++++++---------- ..._deeplabv3_r101-d8_512x512_20k_voc12aug.py | 10 +++-- ...ch_deeplabv3_r101-d8_512x512_80k_ade20k.py | 10 +++-- ...h_deeplabv3_r50-d8_512x512_20k_voc12aug.py | 10 +++-- ..._convnext_base_fp16_640x640_160k_ade20k.py | 7 +++- ..._deeplabv3_r101-d8_512x512_20k_voc12aug.py | 10 +++-- ...ch_deeplabv3_r101-d8_512x512_80k_ade20k.py | 10 +++-- ...h_deeplabv3_r50-d8_512x512_20k_voc12aug.py | 10 +++-- ..._convnext_base_fp16_640x640_160k_ade20k.py | 8 ++-- ..._deeplabv3_r101-d8_512x512_20k_voc12aug.py | 7 +++- ...ch_deeplabv3_r101-d8_512x512_80k_ade20k.py | 7 +++- ...h_deeplabv3_r50-d8_512x512_20k_voc12aug.py | 7 +++- ..._convnext_base_fp16_640x640_160k_ade20k.py | 4 +- .../local_search_config_step16000.json | 2 +- .../local_search_config_step64000.json | 2 +- .../local_search_config_step16000.json | 2 +- .../local_search_config_step64000.json | 2 +- docs/en/tutorials/training_tricks.md | 10 ++--- mmseg/utils/__init__.py | 2 +- tools/test.py | 4 +- tools/train.py | 4 +- 21 files changed, 105 insertions(+), 65 deletions(-) diff --git a/configs/rfnext/README.md b/configs/rfnext/README.md index dad88e6fd67..0960cb55a93 100644 --- a/configs/rfnext/README.md +++ b/configs/rfnext/README.md @@ -13,30 +13,30 @@ The source code is publicly available on [http://mmcheng.net/rfnext](http://mmch ### ConvNext on ADE20K -| Backbone | Method | RFNext | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | config | download | -| :-----------: | :----------------: | :-------------: | :-----: | :-----: | :-----: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -| ConvNeXt-B | UPerNet | NO | 640x640 | 160000 | 52.13 | 52.66 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/convnext/upernet_convnext_tiny_fp16_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_tiny_fp16_512x512_160k_ade20k/upernet_convnext_tiny_fp16_512x512_160k_ade20k_20220227_124553-cad485de.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_tiny_fp16_512x512_160k_ade20k/upernet_convnext_tiny_fp16_512x512_160k_ade20k_20220227_124553.log.json) | -| RF-ConvNext-B | UperNet | Single-Branch | 640x640 | 160000 | 52.51 | 53.12 | [search]() \| [retrain]() | [model]() \| [log]() | -| RF-ConvNext-B | UperNet | Multiple-Branch | 640x640 | 160000 | 52.49 | 53.00 | [search]() \| [retrain]() | [model]() \| [log]() | +| Backbone | Method | RFNext | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | config | download | +| :-----------: | :-----: | :-------------: | :-------: | :-----: | :---: | :------------: | :-----------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| ConvNeXt-B | UPerNet | NO | 640x640 | 160000 | 52.13 | 52.66 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/convnext/upernet_convnext_tiny_fp16_512x512_160k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_tiny_fp16_512x512_160k_ade20k/upernet_convnext_tiny_fp16_512x512_160k_ade20k_20220227_124553-cad485de.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/convnext/upernet_convnext_tiny_fp16_512x512_160k_ade20k/upernet_convnext_tiny_fp16_512x512_160k_ade20k_20220227_124553.log.json) | +| RF-ConvNext-B | UperNet | Single-Branch | 640x640 | 160000 | 52.51 | 53.12 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | +| RF-ConvNext-B | UperNet | Multiple-Branch | 640x640 | 160000 | 52.49 | 53.00 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | ### DeepLabV3 on ADE20K -| Backbone | Method | RFNext | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | config | download | -| :-----------: | :----------------: | :-------------: | :-----: | :-----: | :-----: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -| R-101-D8 | DeepLabV3 | NO | 512x512 | 80000 | 44.08 | 45.19 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256-d89c7fa4.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256.log.json) | -| RF-R-101-D8 | DeepLabV3 | Single-Branch | 512x512 | 80000 | 44.65 | 45.65 | [search]() \| [retrain]() | [model]() \| [log]() | -| RF-R-101-D8 | DeepLabV3 | Multiple-Branch | 512x512 | 80000 | 44.77 | 45.86 | [search]() \| [retrain]() | [model]() \| [log]() | +| Backbone | Method | RFNext | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | config | download | +| :---------: | :-------: | :-------------: | :-------: | :-----: | :---: | :------------: | :--------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| R-101-D8 | DeepLabV3 | NO | 512x512 | 80000 | 44.08 | 45.19 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256-d89c7fa4.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256.log.json) | +| RF-R-101-D8 | DeepLabV3 | Single-Branch | 512x512 | 80000 | 44.65 | 45.65 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | +| RF-R-101-D8 | DeepLabV3 | Multiple-Branch | 512x512 | 80000 | 44.77 | 45.86 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | ### DeepLabV3 on Pascal VOC 2012 + Aug -| Backbone | Method | RFNext | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | config | download | -| :-----------: | :----------------: | :-------------: | :-----: | :-----: | :-----: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -| R-50-D8 | DeepLabV3 | NO | 512x512 | 20000 | 76.17 | 77.42 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r50-d8_512x512_20k_voc12aug.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r50-d8_512x512_20k_voc12aug/deeplabv3_r50-d8_512x512_20k_voc12aug_20200617_010906-596905ef.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r50-d8_512x512_20k_voc12aug/deeplabv3_r50-d8_512x512_20k_voc12aug_20200617_010906.log.json) | -| RF-R-50-D8 | DeepLabV3 | Single-Branch | 512x512 | 20000 | 77.48 | 78.83 | [search]() \| [retrain]() | [model]() \| [log]() | -| RF-R-50-D8 | DeepLabV3 | Multiple-Branch | 512x512 | 20000 | 77.60 | 78.67 | [search]() \| [retrain]() | [model]() \| [log]() | -| R-101-D8 | DeepLabV3 | NO | 512x512 | 20000 | 78.70 | 79.95 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256-d89c7fa4.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256.log.json) | -| RF-R-101-D8 | DeepLabV3 | Single-Branch | 512x512 | 20000 | 79.51 | 80.82 | [search]() \| [retrain]() | [model]() \| [log]() | -| RF-R-101-D8 | DeepLabV3 | Multiple-Branch | 512x512 | 20000 | 79.55 | 80.68 | [search]() \| [retrain]() | [model]() \| [log]() | +| Backbone | Method | RFNext | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | config | download | +| :---------: | :-------: | :-------------: | :-------: | :-----: | :---: | :------------: | :---------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | +| R-50-D8 | DeepLabV3 | NO | 512x512 | 20000 | 76.17 | 77.42 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r50-d8_512x512_20k_voc12aug.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r50-d8_512x512_20k_voc12aug/deeplabv3_r50-d8_512x512_20k_voc12aug_20200617_010906-596905ef.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r50-d8_512x512_20k_voc12aug/deeplabv3_r50-d8_512x512_20k_voc12aug_20200617_010906.log.json) | +| RF-R-50-D8 | DeepLabV3 | Single-Branch | 512x512 | 20000 | 77.48 | 78.83 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | +| RF-R-50-D8 | DeepLabV3 | Multiple-Branch | 512x512 | 20000 | 77.60 | 78.67 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | +| R-101-D8 | DeepLabV3 | NO | 512x512 | 20000 | 78.70 | 79.95 | [config](https://github.com/open-mmlab/mmsegmentation/blob/master/configs/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256-d89c7fa4.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_512x512_80k_ade20k/deeplabv3_r101-d8_512x512_80k_ade20k_20200615_021256.log.json) | +| RF-R-101-D8 | DeepLabV3 | Single-Branch | 512x512 | 20000 | 79.51 | 80.82 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | +| RF-R-101-D8 | DeepLabV3 | Multiple-Branch | 512x512 | 20000 | 79.55 | 80.68 | [search](<>) \| [retrain](<>) | [model](<>) \| [log](<>) | **Note:** The performance of multi-branch models listed above are evaluated during searching to save computional cost, retraining would achieve similar or better performance. @@ -62,9 +62,9 @@ custom_hooks = [ mmin=1, mmax=64, num_branches=3, - skip_layer=[])) - # For the models with auxiliary heads, - # we recommend skipping the layers used by auxiliary heads. + skip_layer=[])) + # For the models with auxiliary heads, + # we recommend skipping the layers used by auxiliary heads. # You can add these layers to `skip_layer`. ), ] diff --git a/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py b/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py index e59caa8659f..b3ce103ea46 100644 --- a/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py +++ b/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_multi_branch', - rfstructure_file='./configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,7 +18,10 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) ] -find_unused_parameters=True \ No newline at end of file +find_unused_parameters = True diff --git a/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py b/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py index 797187826f9..1a394c151e9 100644 --- a/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py +++ b/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_multi_branch', - rfstructure_file='./configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,7 +18,10 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) ] -find_unused_parameters=True +find_unused_parameters = True diff --git a/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py b/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py index 684745aef33..c6ce78ef8f9 100644 --- a/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py +++ b/configs/rfnext/rfnext_fixed_multi_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_multi_branch', - rfstructure_file='./configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,7 +18,10 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) ] -find_unused_parameters=True \ No newline at end of file +find_unused_parameters = True diff --git a/configs/rfnext/rfnext_fixed_multi_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py b/configs/rfnext/rfnext_fixed_multi_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py index 4b23c091b04..f9c4adafd92 100644 --- a/configs/rfnext/rfnext_fixed_multi_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py +++ b/configs/rfnext/rfnext_fixed_multi_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_multi_branch', - rfstructure_file='./configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,5 +18,7 @@ mmin=1, mmax=24, num_branches=3, - skip_layer=['stages.0', 'stages.1', 'stages.2', 'auxiliary_head']))) + skip_layer=[ + 'stages.0', 'stages.1', 'stages.2', 'auxiliary_head' + ]))) ] diff --git a/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py b/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py index fe1703f6906..fe32aa3b2e6 100644 --- a/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py +++ b/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_20k_voc12aug.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_single_branch', - rfstructure_file='./configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,5 +18,8 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) -] \ No newline at end of file + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) +] diff --git a/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py b/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py index 1e9d88b4c99..8da9c47d75b 100644 --- a/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py +++ b/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r101-d8_512x512_80k_ade20k.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_single_branch', - rfstructure_file='./configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,5 +18,8 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) -] \ No newline at end of file + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) +] diff --git a/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py b/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py index d259236b659..0071992eb66 100644 --- a/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py +++ b/configs/rfnext/rfnext_fixed_single_branch_deeplabv3_r50-d8_512x512_20k_voc12aug.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_single_branch', - rfstructure_file='./configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,5 +18,8 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) -] \ No newline at end of file + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) +] diff --git a/configs/rfnext/rfnext_fixed_single_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py b/configs/rfnext/rfnext_fixed_single_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py index 9dee1f05a14..dbbc2f7bde0 100644 --- a/configs/rfnext/rfnext_fixed_single_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py +++ b/configs/rfnext/rfnext_fixed_single_branch_upernet_convnext_base_fp16_640x640_160k_ade20k.py @@ -4,7 +4,8 @@ dict( type='RFSearchHook', mode='fixed_single_branch', - rfstructure_file='./configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json', + rfstructure_file= # noqa + './configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json', # noqa verbose=True, by_epoch=False, config=dict( @@ -17,6 +18,7 @@ mmin=1, mmax=24, num_branches=3, - skip_layer=['stages.0', 'stages.1', 'stages.2', 'auxiliary_head']))) + skip_layer=[ + 'stages.0', 'stages.1', 'stages.2', 'auxiliary_head' + ]))) ] -cudnn_benchmark=False \ No newline at end of file diff --git a/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_20k_voc12aug.py b/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_20k_voc12aug.py index 92aa06517a6..4a976ee598d 100644 --- a/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_20k_voc12aug.py +++ b/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_20k_voc12aug.py @@ -17,7 +17,10 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) ] -find_unused_parameters=True \ No newline at end of file +find_unused_parameters = True diff --git a/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_80k_ade20k.py b/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_80k_ade20k.py index 4c156c3d0d5..1c93335ed0e 100644 --- a/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_80k_ade20k.py +++ b/configs/rfnext/rfnext_search_deeplabv3_r101-d8_512x512_80k_ade20k.py @@ -17,7 +17,10 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) ] -find_unused_parameters=True +find_unused_parameters = True diff --git a/configs/rfnext/rfnext_search_deeplabv3_r50-d8_512x512_20k_voc12aug.py b/configs/rfnext/rfnext_search_deeplabv3_r50-d8_512x512_20k_voc12aug.py index ef1d4002ce0..1da31329a5e 100644 --- a/configs/rfnext/rfnext_search_deeplabv3_r50-d8_512x512_20k_voc12aug.py +++ b/configs/rfnext/rfnext_search_deeplabv3_r50-d8_512x512_20k_voc12aug.py @@ -17,7 +17,10 @@ mmin=1, mmax=64, num_branches=3, - skip_layer=['stem', 'conv1', 'layer1', 'layer2', 'layer3', 'auxiliary_head']))) + skip_layer=[ + 'stem', 'conv1', 'layer1', 'layer2', 'layer3', + 'auxiliary_head' + ]))) ] -find_unused_parameters=True \ No newline at end of file +find_unused_parameters = True diff --git a/configs/rfnext/rfnext_search_upernet_convnext_base_fp16_640x640_160k_ade20k.py b/configs/rfnext/rfnext_search_upernet_convnext_base_fp16_640x640_160k_ade20k.py index cfd6991aee0..7f3a1d3b2fc 100644 --- a/configs/rfnext/rfnext_search_upernet_convnext_base_fp16_640x640_160k_ade20k.py +++ b/configs/rfnext/rfnext_search_upernet_convnext_base_fp16_640x640_160k_ade20k.py @@ -17,5 +17,7 @@ mmin=1, mmax=24, num_branches=3, - skip_layer=['stages.0', 'stages.1', 'stages.2', 'auxiliary_head']))) + skip_layer=[ + 'stages.0', 'stages.1', 'stages.2', 'auxiliary_head' + ]))) ] diff --git a/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json b/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json index 92025fda9f1..7c88227007e 100644 --- a/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json +++ b/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_20k_voc12aug/local_search_config_step16000.json @@ -1 +1 @@ -{"search": {"step": 16000, "max_step": 16001, "search_interval": 2000, "exp_rate": 0.15, "init_alphas": 0.01, "mmin": 1, "mmax": 64, "num_branches": 3, "skip_layer": ["stem", "conv1", "layer1", "layer2", "layer3", "auxiliary_head"]}, "structure": {"module.backbone.layer4.0.conv2": [2, 2], "module.backbone.layer4.1.conv2": [8, 8], "module.backbone.layer4.2.conv2": [6, 6], "module.decode_head.aspp_modules.1.conv": [12, 12], "module.decode_head.aspp_modules.2.conv": [24, 24], "module.decode_head.aspp_modules.3.conv": [43, 43], "module.decode_head.bottleneck.conv": [1, 1]}} \ No newline at end of file +{"search": {"step": 16000, "max_step": 16001, "search_interval": 2000, "exp_rate": 0.15, "init_alphas": 0.01, "mmin": 1, "mmax": 64, "num_branches": 3, "skip_layer": ["stem", "conv1", "layer1", "layer2", "layer3", "auxiliary_head"]}, "structure": {"module.backbone.layer4.0.conv2": [2, 2], "module.backbone.layer4.1.conv2": [8, 8], "module.backbone.layer4.2.conv2": [6, 6], "module.decode_head.aspp_modules.1.conv": [12, 12], "module.decode_head.aspp_modules.2.conv": [24, 24], "module.decode_head.aspp_modules.3.conv": [43, 43], "module.decode_head.bottleneck.conv": [1, 1]}} diff --git a/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json b/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json index 8d172cf0e9f..3c6f6d88dbf 100644 --- a/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json +++ b/configs/rfnext/search_log/deeplabv3_r101-d8_512x512_80k_ade20k/local_search_config_step64000.json @@ -1 +1 @@ -{"search": {"step": 64000, "max_step": 64001, "search_interval": 8000, "exp_rate": 0.15, "init_alphas": 0.01, "mmin": 1, "mmax": 64, "num_branches": 3, "skip_layer": ["stem", "conv1", "layer1", "layer2", "layer3", "auxiliary_head"]}, "structure": {"module.backbone.layer4.0.conv2": [2, 2], "module.backbone.layer4.1.conv2": [8, 8], "module.backbone.layer4.2.conv2": [6, 6], "module.decode_head.aspp_modules.1.conv": [12, 12], "module.decode_head.aspp_modules.2.conv": [24, 24], "module.decode_head.aspp_modules.3.conv": [41, 41], "module.decode_head.bottleneck.conv": [1, 1]}} \ No newline at end of file +{"search": {"step": 64000, "max_step": 64001, "search_interval": 8000, "exp_rate": 0.15, "init_alphas": 0.01, "mmin": 1, "mmax": 64, "num_branches": 3, "skip_layer": ["stem", "conv1", "layer1", "layer2", "layer3", "auxiliary_head"]}, "structure": {"module.backbone.layer4.0.conv2": [2, 2], "module.backbone.layer4.1.conv2": [8, 8], "module.backbone.layer4.2.conv2": [6, 6], "module.decode_head.aspp_modules.1.conv": [12, 12], "module.decode_head.aspp_modules.2.conv": [24, 24], "module.decode_head.aspp_modules.3.conv": [41, 41], "module.decode_head.bottleneck.conv": [1, 1]}} diff --git a/configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json b/configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json index acba93e0569..1dda2ed02bf 100644 --- a/configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json +++ b/configs/rfnext/search_log/deeplabv3_r50-d8_512x512_20k_voc12aug/local_search_config_step16000.json @@ -1 +1 @@ -{"search": {"step": 16000, "max_step": 16001, "search_interval": 2000, "exp_rate": 0.15, "init_alphas": 0.01, "mmin": 1, "mmax": 64, "num_branches": 3, "skip_layer": ["stem", "conv1", "layer1", "layer2", "layer3", "auxiliary_head"]}, "structure": {"module.backbone.layer4.0.conv2": [2, 2], "module.backbone.layer4.1.conv2": [7, 7], "module.backbone.layer4.2.conv2": [6, 6], "module.decode_head.aspp_modules.1.conv": [12, 12], "module.decode_head.aspp_modules.2.conv": [23, 23], "module.decode_head.aspp_modules.3.conv": [41, 41], "module.decode_head.bottleneck.conv": [1, 1]}} \ No newline at end of file +{"search": {"step": 16000, "max_step": 16001, "search_interval": 2000, "exp_rate": 0.15, "init_alphas": 0.01, "mmin": 1, "mmax": 64, "num_branches": 3, "skip_layer": ["stem", "conv1", "layer1", "layer2", "layer3", "auxiliary_head"]}, "structure": {"module.backbone.layer4.0.conv2": [2, 2], "module.backbone.layer4.1.conv2": [7, 7], "module.backbone.layer4.2.conv2": [6, 6], "module.decode_head.aspp_modules.1.conv": [12, 12], "module.decode_head.aspp_modules.2.conv": [23, 23], "module.decode_head.aspp_modules.3.conv": [41, 41], "module.decode_head.bottleneck.conv": [1, 1]}} diff --git a/configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json b/configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json index 75b07345321..9fcd1c9514e 100644 --- a/configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json +++ b/configs/rfnext/search_log/upernet_convnext_base_fp16_640x640_160k_ade20k/local_search_config_step64000.json @@ -1 +1 @@ -{"search": {"step": 64000, "max_step": 64001, "search_interval": 8000, "exp_rate": 0.5, "init_alphas": 0.01, "mmin": 1, "mmax": 24, "num_branches": 3, "skip_layer": ["stages.0", "stages.1", "stages.2", "auxiliary_head"]}, "structure": {"module.backbone.stages.3.0.depthwise_conv": [3, 3], "module.backbone.stages.3.1.depthwise_conv": [3, 3], "module.backbone.stages.3.2.depthwise_conv": [2, 2], "module.decode_head.bottleneck.conv": [6, 6], "module.decode_head.fpn_convs.0.conv": [1, 1], "module.decode_head.fpn_convs.1.conv": [3, 3], "module.decode_head.fpn_convs.2.conv": [3, 3], "module.decode_head.fpn_bottleneck.conv": [1, 1]}} \ No newline at end of file +{"search": {"step": 64000, "max_step": 64001, "search_interval": 8000, "exp_rate": 0.5, "init_alphas": 0.01, "mmin": 1, "mmax": 24, "num_branches": 3, "skip_layer": ["stages.0", "stages.1", "stages.2", "auxiliary_head"]}, "structure": {"module.backbone.stages.3.0.depthwise_conv": [3, 3], "module.backbone.stages.3.1.depthwise_conv": [3, 3], "module.backbone.stages.3.2.depthwise_conv": [2, 2], "module.decode_head.bottleneck.conv": [6, 6], "module.decode_head.fpn_convs.0.conv": [1, 1], "module.decode_head.fpn_convs.1.conv": [3, 3], "module.decode_head.fpn_convs.2.conv": [3, 3], "module.decode_head.fpn_bottleneck.conv": [1, 1]}} diff --git a/docs/en/tutorials/training_tricks.md b/docs/en/tutorials/training_tricks.md index f074ebc3a0c..9154cff2d12 100644 --- a/docs/en/tutorials/training_tricks.md +++ b/docs/en/tutorials/training_tricks.md @@ -91,7 +91,7 @@ model = dict( ## Efficient Receptive Field Search (RF-Next) -In semantic segmentation, existing methods construct models with hand-designed receptive fields in layers, +In semantic segmentation, existing methods construct models with hand-designed receptive fields in layers, which may be suboptimal. The RF-Next could effectively search for new receptive field combinations, which could achieve better performance than hand-designed patterns. @@ -115,12 +115,12 @@ custom_hooks = [ mmin=1, mmax=64, num_branches=3, - skip_layer=[])) - # For the models with auxiliary heads, - # we recommend skipping the layers used by auxiliary heads. + skip_layer=[])) + # For the models with auxiliary heads, + # we recommend skipping the layers used by auxiliary heads. # You can add these layers to `skip_layer`. ), ] ``` -For detailed usage, please see [readme](../../../configs/rfnext/README.md). \ No newline at end of file +For detailed usage, please see [readme](../../../configs/rfnext/README.md). diff --git a/mmseg/utils/__init__.py b/mmseg/utils/__init__.py index bfd6d9ec830..e738ba02f3d 100644 --- a/mmseg/utils/__init__.py +++ b/mmseg/utils/__init__.py @@ -2,9 +2,9 @@ from .collect_env import collect_env from .logger import get_root_logger from .misc import find_latest_checkpoint +from .rfnext import rfnext_init_model from .set_env import setup_multi_processes from .util_distribution import build_ddp, build_dp, get_device -from .rfnext import rfnext_init_model __all__ = [ 'get_root_logger', 'collect_env', 'find_latest_checkpoint', diff --git a/tools/test.py b/tools/test.py index 04830ab8c53..93afe2e5d84 100644 --- a/tools/test.py +++ b/tools/test.py @@ -17,8 +17,8 @@ from mmseg.apis import multi_gpu_test, single_gpu_test from mmseg.datasets import build_dataloader, build_dataset from mmseg.models import build_segmentor -from mmseg.utils import (build_ddp, build_dp, get_device, setup_multi_processes, - rfnext_init_model) +from mmseg.utils import (build_ddp, build_dp, get_device, rfnext_init_model, + setup_multi_processes) def parse_args(): diff --git a/tools/train.py b/tools/train.py index 8d1d0578f4c..f76d8f89295 100644 --- a/tools/train.py +++ b/tools/train.py @@ -18,7 +18,7 @@ from mmseg.datasets import build_dataset from mmseg.models import build_segmentor from mmseg.utils import (collect_env, get_device, get_root_logger, - setup_multi_processes, rfnext_init_model) + rfnext_init_model, setup_multi_processes) def parse_args(): @@ -203,7 +203,7 @@ def main(): # init rfnext if 'RFSearchHook' is defined in cfg rfnext_init_model(model, cfg=cfg) - + # SyncBN is not support for DP if not distributed: warnings.warn(