Skip to content

Commit

Permalink
fix bn eps and data_preprocessor
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyang07 committed Aug 31, 2022
1 parent 08964ce commit a3f7017
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
14 changes: 10 additions & 4 deletions configs/_base_/nas_backbones/dsnas_shufflenet_supernet.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
norm_cfg = dict(type='BN', eps=0.01)

_STAGE_MUTABLE = dict(
type='mmrazor.OneHotMutableOP',
candidates=dict(
shuffle_3x3=dict(type='ShuffleBlock', kernel_size=3),
shuffle_5x5=dict(type='ShuffleBlock', kernel_size=5),
shuffle_7x7=dict(type='ShuffleBlock', kernel_size=7),
shuffle_xception=dict(type='ShuffleXception')))
shuffle_3x3=dict(
type='ShuffleBlock', kernel_size=3, norm_cfg=norm_cfg),
shuffle_5x5=dict(
type='ShuffleBlock', kernel_size=5, norm_cfg=norm_cfg),
shuffle_7x7=dict(
type='ShuffleBlock', kernel_size=7, norm_cfg=norm_cfg),
shuffle_xception=dict(type='ShuffleXception', norm_cfg=norm_cfg)))

arch_setting = [
# Parameters to build layers. 3 parameters are needed to construct a
Expand All @@ -19,4 +24,5 @@
type='mmrazor.SearchableShuffleNetV2',
widen_factor=1.0,
arch_setting=arch_setting,
norm_cfg=norm_cfg,
adjust_channels=True)
5 changes: 3 additions & 2 deletions configs/_base_/settings/imagenet_bs1024_dsnas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# dataset settings
dataset_type = 'mmcls.ImageNet'
preprocess_cfg = dict(
data_preprocessor = dict(
type='mmcls.ClsDataPreprocessor',
# RGB format normalization parameters
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
Expand All @@ -23,7 +24,7 @@
]

train_dataloader = dict(
batch_size=512,
batch_size=1024,
num_workers=15,
dataset=dict(
type=dataset_type,
Expand Down

0 comments on commit a3f7017

Please sign in to comment.