Skip to content

Commit b0783c7

Browse files
willthefrogqingqing01
authored andcommitted
Fix a bug in command line option parsing (#2841)
option should not be overridden by subsequent options of the same module
1 parent c755cdf commit b0783c7

File tree

1 file changed

+2
-1
lines changed
  • PaddleCV/PaddleDetection/ppdet/utils

1 file changed

+2
-1
lines changed

PaddleCV/PaddleDetection/ppdet/utils/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def _parse_opt(self, opts):
6868
config[k] = yaml.load(v, Loader=yaml.Loader)
6969
else:
7070
keys = k.split('.')
71-
config[keys[0]] = {}
71+
if keys[0] not in config:
72+
config[keys[0]] = {}
7273
cur = config[keys[0]]
7374
for idx, key in enumerate(keys[1:]):
7475
if idx == len(keys) - 2:

0 commit comments

Comments
 (0)