Skip to content

Commit e9d5b46

Browse files
When testing my model with tools/test.py, my config will be messed up by the "--save-preds" option. (#2052)
* fix tools/test.py * fix tools/test.py * Update tools/test.py --------- Co-authored-by: Tong Gao <[email protected]>
1 parent 1d3b1ca commit e9d5b46

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/test.py

+5
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ def main():
121121
if isinstance(cfg.test_evaluator, (list, tuple)):
122122
cfg.test_evaluator = list(cfg.test_evaluator)
123123
cfg.test_evaluator.append(dump_metric)
124+
elif isinstance(cfg.test_evaluator, dict):
125+
if 'metrics' in cfg.test_evaluator:
126+
cfg.test_evaluator['metrics'].append(dump_metric)
127+
else:
128+
cfg.test_evaluator['metrics'] = [dump_metric]
124129
else:
125130
cfg.test_evaluator = [cfg.test_evaluator, dump_metric]
126131

0 commit comments

Comments
 (0)