mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
[Refactor]Resume do not specify ckpt (#2074)
* [Refactor]Resume do not specify ckpt * add default false value
This commit is contained in:
parent
0097dfbabc
commit
3388cfd475
@ -18,12 +18,9 @@ def parse_args():
|
|||||||
parser.add_argument('--work-dir', help='the dir to save logs and models')
|
parser.add_argument('--work-dir', help='the dir to save logs and models')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--resume',
|
'--resume',
|
||||||
nargs='?',
|
action='store_true',
|
||||||
type=str,
|
default=False,
|
||||||
const='auto',
|
help='resume from the latest checkpoint in the work_dir automatically')
|
||||||
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(
|
parser.add_argument(
|
||||||
'--amp',
|
'--amp',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
@ -90,12 +87,7 @@ def main():
|
|||||||
cfg.optim_wrapper.loss_scale = 'dynamic'
|
cfg.optim_wrapper.loss_scale = 'dynamic'
|
||||||
|
|
||||||
# resume training
|
# resume training
|
||||||
if args.resume == 'auto':
|
cfg.resume = args.resume
|
||||||
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
|
# build the runner from config
|
||||||
if 'runner_type' not in cfg:
|
if 'runner_type' not in cfg:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user