Skip to content

Commit

Permalink
[Fix] fix --local-rank
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyixiao18 committed Apr 27, 2022
1 parent c0d2680 commit 96af961
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tools/benchmarks/classification/knn_imagenet/test_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='+',
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 1 addition & 6 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='+',
Expand All @@ -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)
Expand Down
7 changes: 1 addition & 6 deletions tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 96af961

Please sign in to comment.