From 3a2a8ff24ed7f4eee49cee6c823e2b8910f8be2a Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Fri, 26 Jul 2019 17:28:47 +0800 Subject: [PATCH] Fix a bug in command line option parsing (#2941) option should not be overridden by subsequent options of the same module. --- ppdet/utils/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ppdet/utils/cli.py b/ppdet/utils/cli.py index 665a29254..285918cf5 100644 --- a/ppdet/utils/cli.py +++ b/ppdet/utils/cli.py @@ -68,7 +68,8 @@ class ArgsParser(ArgumentParser): config[k] = yaml.load(v, Loader=yaml.Loader) else: keys = k.split('.') - config[keys[0]] = {} + if keys[0] not in config: + config[keys[0]] = {} cur = config[keys[0]] for idx, key in enumerate(keys[1:]): if idx == len(keys) - 2: -- GitLab