Unverified Commit fb23980e authored by Xiang Xu's avatar Xiang Xu Committed by GitHub
Browse files

[Fix] Fix conflict of resume argument (#2224)

* fix `resume` error

* fix
parent 341ff998
......@@ -27,8 +27,12 @@ def parse_args():
help='enable automatically scaling LR.')
parser.add_argument(
'--resume',
action='store_true',
help='resume from the latest checkpoint in the work_dir automatically')
nargs='?',
type=str,
const='auto',
help='If specify checkpoint path, resume from it, while if not '
'specify, try to auto resume from the latest checkpoint '
'in the work directory.')
parser.add_argument(
'--ceph', action='store_true', help='Use ceph as data storage backend')
parser.add_argument(
......@@ -105,7 +109,14 @@ def main():
'"auto_scale_lr.enable" or '
'"auto_scale_lr.base_batch_size" in your'
' configuration file.')
cfg.resume = args.resume
# resume is determined in this priority: resume from > auto_resume
if args.resume == 'auto':
cfg.resume = True
cfg.load_from = None
elif args.resume is not None:
cfg.resume = True
cfg.load_from = args.resume
# build the runner from config
if 'runner_type' not in cfg:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment