Skip to content

Commit

Permalink
[Improvement] Move train_cfg/test_cfg inside model (#341)
Browse files Browse the repository at this point in the history
* [Improvement] Move train_cfg/test_cfg inside model

* fixed config dict

* fixed config dict
  • Loading branch information
xvjiarui authored Jan 20, 2021
1 parent c8bbd3f commit 4423d32
Show file tree
Hide file tree
Showing 88 changed files with 266 additions and 247 deletions.
8 changes: 4 additions & 4 deletions configs/_base_/models/ann_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/apcnet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/ccnet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/cgnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
10.289121, 9.953208, 4.3097677, 9.490387, 7.674431, 9.396905,
10.347791, 6.3927646, 10.226669, 10.241062, 10.280587,
10.396974, 10.055647
])))
# model training and testing settings
train_cfg = dict(sampler=None)
test_cfg = dict(mode='whole')
])),
# model training and testing settings
train_cfg=dict(sampler=None),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/danet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/deeplabv3_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/deeplabv3_unet_s5-d16.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='slide', crop_size=256, stride=170)
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='slide', crop_size=256, stride=170))
8 changes: 4 additions & 4 deletions configs/_base_/models/deeplabv3plus_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/dmnet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/dnl_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/emanet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/encnet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
9 changes: 4 additions & 5 deletions configs/_base_/models/fast_scnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=True, loss_weight=0.4)),
])

# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
],
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/fcn_hr18.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/fcn_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/fcn_unet_s5-d16.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='slide', crop_size=256, stride=170)
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='slide', crop_size=256, stride=170))
8 changes: 4 additions & 4 deletions configs/_base_/models/fpn_r50.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/gcnet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/lraspp_m-v3-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
act_cfg=dict(type='ReLU'),
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/nonlocal_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/ocrnet_hr18.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
])
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
],
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/ocrnet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))
])
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
],
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
18 changes: 9 additions & 9 deletions configs/_base_/models/pointrend_r50.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))
])
# model training and testing settings
train_cfg = dict(
num_points=2048, oversample_ratio=3, importance_sample_ratio=0.75)
test_cfg = dict(
mode='whole',
subdivision_steps=2,
subdivision_num_points=8196,
scale_factor=2)
],
# model training and testing settings
train_cfg=dict(
num_points=2048, oversample_ratio=3, importance_sample_ratio=0.75),
test_cfg=dict(
mode='whole',
subdivision_steps=2,
subdivision_num_points=8196,
scale_factor=2))
8 changes: 4 additions & 4 deletions configs/_base_/models/psanet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/pspnet_r50-d8.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
8 changes: 4 additions & 4 deletions configs/_base_/models/pspnet_unet_s5-d16.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='slide', crop_size=256, stride=170)
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='slide', crop_size=256, stride=170))
8 changes: 4 additions & 4 deletions configs/_base_/models/upernet_r50.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
norm_cfg=norm_cfg,
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)))
# model training and testing settings
train_cfg = dict()
test_cfg = dict(mode='whole')
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
# model training and testing settings
train_cfg=dict(),
test_cfg=dict(mode='whole'))
4 changes: 2 additions & 2 deletions configs/ann/ann_r50-d8_769x769_40k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
4 changes: 2 additions & 2 deletions configs/ann/ann_r50-d8_769x769_80k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
4 changes: 2 additions & 2 deletions configs/apcnet/apcnet_r50-d8_769x769_40k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
4 changes: 2 additions & 2 deletions configs/apcnet/apcnet_r50-d8_769x769_80k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
4 changes: 2 additions & 2 deletions configs/ccnet/ccnet_r50-d8_769x769_40k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
4 changes: 2 additions & 2 deletions configs/ccnet/ccnet_r50-d8_769x769_80k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
4 changes: 2 additions & 2 deletions configs/danet/danet_r50-d8_769x769_40k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
4 changes: 2 additions & 2 deletions configs/danet/danet_r50-d8_769x769_80k_cityscapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
]
model = dict(
decode_head=dict(align_corners=True),
auxiliary_head=dict(align_corners=True))
test_cfg = dict(mode='slide', crop_size=(769, 769), stride=(513, 513))
auxiliary_head=dict(align_corners=True),
test_cfg=dict(mode='slide', crop_size=(769, 769), stride=(513, 513)))
Loading

0 comments on commit 4423d32

Please sign in to comment.