"...resnet50_tensorflow.git" did not exist on "6ba862f1cc379f215335ced5c83a8bba0c47e684"
Commit aec41c7f authored by zhangwenwei's avatar zhangwenwei
Browse files

Merge master

parents 49f06039 4eca6606
#!/usr/bin/env bash #!/usr/bin/env bash
set -x set -x
export PYTHONPATH=`pwd`:$PYTHONPATH
PARTITION=$1 PARTITION=$1
JOB_NAME=$2 JOB_NAME=$2
...@@ -20,4 +19,4 @@ srun -p ${PARTITION} \ ...@@ -20,4 +19,4 @@ srun -p ${PARTITION} \
--ntasks-per-node=${GPUS_PER_NODE} \ --ntasks-per-node=${GPUS_PER_NODE} \
--kill-on-bad-exit=1 \ --kill-on-bad-exit=1 \
${SRUN_ARGS} \ ${SRUN_ARGS} \
python -u tools/train.py ${CONFIG} --work_dir=${WORK_DIR} --launcher="slurm" ${PY_ARGS} python -u tools/train.py ${CONFIG} --work-dir=${WORK_DIR} --launcher="slurm" ${PY_ARGS}
...@@ -11,10 +11,11 @@ from mmcv import Config ...@@ -11,10 +11,11 @@ from mmcv import Config
from mmcv.runner import init_dist from mmcv.runner import init_dist
from mmdet3d import __version__ from mmdet3d import __version__
from mmdet3d.apis import train_detector
from mmdet3d.datasets import build_dataset from mmdet3d.datasets import build_dataset
from mmdet3d.models import build_detector from mmdet3d.models import build_detector
from mmdet3d.utils import collect_env from mmdet3d.utils import collect_env
from mmdet.apis import get_root_logger, set_random_seed, train_detector from mmdet.apis import get_root_logger, set_random_seed
def parse_args(): def parse_args():
...@@ -27,12 +28,18 @@ def parse_args(): ...@@ -27,12 +28,18 @@ def parse_args():
'--validate', '--validate',
action='store_true', action='store_true',
help='whether to evaluate the checkpoint during training') help='whether to evaluate the checkpoint during training')
parser.add_argument( group_gpus = parser.add_mutually_exclusive_group()
group_gpus.add_argument(
'--gpus', '--gpus',
type=int, type=int,
default=1,
help='number of gpus to use ' help='number of gpus to use '
'(only applicable to non-distributed training)') '(only applicable to non-distributed training)')
group_gpus.add_argument(
'--gpu-ids',
type=int,
nargs='+',
help='ids of gpus to use '
'(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(
'--deterministic', '--deterministic',
...@@ -73,11 +80,14 @@ def main(): ...@@ -73,11 +80,14 @@ 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
cfg.gpus = args.gpus if args.gpu_ids is not None:
cfg.gpu_ids = args.gpu_ids
else:
cfg.gpu_ids = range(1) if args.gpus is None else range(args.gpus)
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)
cfg.optimizer['lr'] = cfg.optimizer['lr'] * cfg.gpus / 8 cfg.optimizer['lr'] = cfg.optimizer['lr'] * len(cfg.gpu_ids) / 8
# init distributed env first, since logger depends on the dist info. # init distributed env first, since logger depends on the dist info.
if args.launcher == 'none': if args.launcher == 'none':
......
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