From 09e2bf6fa0501590b3cb90018baf2e1068c6c581 Mon Sep 17 00:00:00 2001 From: csatsurnh Date: Thu, 12 Jan 2023 13:12:25 +0800 Subject: [PATCH 1/3] fix append --- tools/test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 61004d8c187..58811350836 100644 --- a/tools/test.py +++ b/tools/test.py @@ -108,7 +108,8 @@ def merge_args(cfg, args): 'The dump file must be a pkl file.' dump_metric = dict(type='DumpResults', out_file_path=args.dump) if isinstance(cfg.test_evaluator, (list, tuple)): - cfg.test_evaluator = list(cfg.test_evaluator).append(dump_metric) + cfg.test_evaluator = list(cfg.test_evaluator) + cfg.test_evaluator.append(dump_metric) else: cfg.test_evaluator = [cfg.test_evaluator, dump_metric] @@ -164,7 +165,11 @@ def main(): # load config cfg = Config.fromfile(args.config) + assert 'test_evaluator' in cfg and cfg['test_evaluator'] is not None + cfg = merge_args(cfg, args) + assert 'test_evaluator' in cfg and cfg['test_evaluator'] is not None + # build the runner from config runner = Runner.from_cfg(cfg) From cbbb2774e7fc60528aa5142da20dfb5bcb7a5438 Mon Sep 17 00:00:00 2001 From: CSH <40987381+csatsurnh@users.noreply.github.com> Date: Thu, 12 Jan 2023 13:16:07 +0800 Subject: [PATCH 2/3] Update test.py --- tools/test.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/test.py b/tools/test.py index 58811350836..6759f5d1d2c 100644 --- a/tools/test.py +++ b/tools/test.py @@ -165,11 +165,8 @@ def main(): # load config cfg = Config.fromfile(args.config) - assert 'test_evaluator' in cfg and cfg['test_evaluator'] is not None cfg = merge_args(cfg, args) - assert 'test_evaluator' in cfg and cfg['test_evaluator'] is not None - # build the runner from config runner = Runner.from_cfg(cfg) From fdef2c9ce76e893e222a59e2fc04ef1b48685d14 Mon Sep 17 00:00:00 2001 From: CSH <40987381+csatsurnh@users.noreply.github.com> Date: Thu, 12 Jan 2023 13:16:24 +0800 Subject: [PATCH 3/3] Update test.py --- tools/test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 6759f5d1d2c..308675b5ccf 100644 --- a/tools/test.py +++ b/tools/test.py @@ -165,7 +165,6 @@ def main(): # load config cfg = Config.fromfile(args.config) - cfg = merge_args(cfg, args) # build the runner from config