diff --git a/tools/benchmarks/classification/knn_imagenet/test_knn.py b/tools/benchmarks/classification/knn_imagenet/test_knn.py index 51c6f352e..68547c0ba 100644 --- a/tools/benchmarks/classification/knn_imagenet/test_knn.py +++ b/tools/benchmarks/classification/knn_imagenet/test_knn.py @@ -31,7 +31,6 @@ def parse_args(): choices=['none', 'pytorch', 'slurm', 'mpi'], default='none', help='job launcher') - parser.add_argument('--local-rank', type=int, default=0) parser.add_argument( '--cfg-options', nargs='+', @@ -59,6 +58,7 @@ def parse_args(): default=True, type=bool, help='Store the features on GPU. Set to False if you encounter OOM') + parser.add_argument('--local_rank', type=int, default=0) args = parser.parse_args() if 'LOCAL_RANK' not in os.environ: os.environ['LOCAL_RANK'] = str(args.local_rank) diff --git a/tools/test.py b/tools/test.py index 69211ec34..226842ea1 100644 --- a/tools/test.py +++ b/tools/test.py @@ -37,12 +37,6 @@ def parse_args(): default=0, help='id of gpu to use ' '(only applicable to non-distributed testing)') - parser.add_argument( - '--local_rank', - type=int, - default=0, - help='(Deprecated, please use --local-rank)') - parser.add_argument('--local-rank', type=int, default=0) parser.add_argument( '--cfg-options', nargs='+', @@ -53,6 +47,7 @@ def parse_args(): 'It also allows nested list/tuple values, e.g. key="[(a,b),(c,d)]" ' 'Note that the quotation marks are necessary and that no white space ' 'is allowed.') + parser.add_argument('--local_rank', type=int, default=0) args = parser.parse_args() if 'LOCAL_RANK' not in os.environ: os.environ['LOCAL_RANK'] = str(args.local_rank) diff --git a/tools/train.py b/tools/train.py index a38ef20f4..7b8d43c18 100644 --- a/tools/train.py +++ b/tools/train.py @@ -80,12 +80,7 @@ def parse_args(): choices=['none', 'pytorch', 'slurm', 'mpi'], default='none', help='job launcher') - parser.add_argument( - '--local_rank', - type=int, - default=0, - help='(Deprecated, please use --local-rank)') - parser.add_argument('--local-rank', type=int, default=0) + parser.add_argument('--local_rank', type=int, default=0) args = parser.parse_args() if 'LOCAL_RANK' not in os.environ: os.environ['LOCAL_RANK'] = str(args.local_rank)