Skip to content

Commit 7ec952f

Browse files
LehsubyZwwWayne
authored andcommitted
[Fix]: Fix get train_pipeline method of val workflow (#8575)
1 parent 03a6244 commit 7ec952f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/train.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,10 @@ def main():
217217

218218
datasets = [build_dataset(cfg.data.train)]
219219
if len(cfg.workflow) == 2:
220+
assert 'val' in [mode for (mode, _) in cfg.workflow]
220221
val_dataset = copy.deepcopy(cfg.data.val)
221-
val_dataset.pipeline = cfg.data.train.pipeline
222+
val_dataset.pipeline = cfg.data.train.get(
223+
'pipeline', cfg.data.train.dataset.get('pipeline'))
222224
datasets.append(build_dataset(val_dataset))
223225
if cfg.checkpoint_config is not None:
224226
# save mmdet version, config file content and class names in

0 commit comments

Comments
 (0)