Skip to content

Commit

Permalink
fix link
Browse files Browse the repository at this point in the history
  • Loading branch information
lzyhha committed Jan 12, 2023
1 parent 8c78c40 commit d932f73
Show file tree
Hide file tree
Showing 21 changed files with 105 additions and 65 deletions.
42 changes: 21 additions & 21 deletions configs/rfnext/README.md

Large diffs are not rendered by default.

Expand Up @@ -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(
Expand All @@ -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
Expand Up @@ -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(
Expand All @@ -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
Expand Up @@ -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(
Expand All @@ -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
Expand Up @@ -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(
Expand All @@ -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'
])))
]
Expand Up @@ -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(
Expand All @@ -17,5 +18,8 @@
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'
])))
]
Expand Up @@ -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(
Expand All @@ -17,5 +18,8 @@
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'
])))
]
Expand Up @@ -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(
Expand All @@ -17,5 +18,8 @@
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'
])))
]
Expand Up @@ -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(
Expand All @@ -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
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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
Expand Up @@ -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'
])))
]
@@ -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]}}
{"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]}}
@@ -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]}}
{"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]}}
@@ -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]}}
{"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]}}
@@ -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]}}
{"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]}}
10 changes: 5 additions & 5 deletions docs/en/tutorials/training_tricks.md
Expand Up @@ -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.

Expand All @@ -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).
For detailed usage, please see [readme](../../../configs/rfnext/README.md).
2 changes: 1 addition & 1 deletion mmseg/utils/__init__.py
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions tools/test.py
Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions tools/train.py
Expand Up @@ -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():
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d932f73

Please sign in to comment.