Commit 91925016 authored by Tai-Wang's avatar Tai-Wang
Browse files

Merge branch 'master' into v1.0.0.dev0

parents 95c2db72 dabe3ff4
...@@ -43,13 +43,19 @@ def parse_args(): ...@@ -43,13 +43,19 @@ def parse_args():
group_gpus.add_argument( group_gpus.add_argument(
'--gpus', '--gpus',
type=int, type=int,
help='number of gpus to use ' help='(Deprecated, please use --gpu-id) number of gpus to use '
'(only applicable to non-distributed training)') '(only applicable to non-distributed training)')
group_gpus.add_argument( group_gpus.add_argument(
'--gpu-ids', '--gpu-ids',
type=int, type=int,
nargs='+', nargs='+',
help='ids of gpus to use ' help='(Deprecated, please use --gpu-id) ids of gpus to use '
'(only applicable to non-distributed training)')
group_gpus.add_argument(
'--gpu-id',
type=int,
default=0,
help='number of gpus to use '
'(only applicable to non-distributed training)') '(only applicable to non-distributed training)')
parser.add_argument('--seed', type=int, default=0, help='random seed') parser.add_argument('--seed', type=int, default=0, help='random seed')
parser.add_argument( parser.add_argument(
...@@ -122,10 +128,19 @@ def main(): ...@@ -122,10 +128,19 @@ def main():
osp.splitext(osp.basename(args.config))[0]) osp.splitext(osp.basename(args.config))[0])
if args.resume_from is not None: if args.resume_from is not None:
cfg.resume_from = args.resume_from cfg.resume_from = args.resume_from
if args.gpus is not None:
cfg.gpu_ids = range(1)
warnings.warn('`--gpus` is deprecated because we only support '
'single GPU mode in non-distributed training. '
'Use `gpus=1` now.')
if args.gpu_ids is not None: if args.gpu_ids is not None:
cfg.gpu_ids = args.gpu_ids cfg.gpu_ids = args.gpu_ids[0:1]
else: warnings.warn('`--gpu-ids` is deprecated, please use `--gpu-id`. '
cfg.gpu_ids = range(1) if args.gpus is None else range(args.gpus) 'Because we only support single GPU mode in '
'non-distributed training. Use the first GPU '
'in `gpu_ids` now.')
if args.gpus is None and args.gpu_ids is None:
cfg.gpu_ids = [args.gpu_id]
if args.autoscale_lr: if args.autoscale_lr:
# apply the linear scaling rule (https://arxiv.org/abs/1706.02677) # apply the linear scaling rule (https://arxiv.org/abs/1706.02677)
......
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