mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
[Fix] Fix accepting an unexpected argument local-rank in PyTorch 2.0 (#2813)
This commit is contained in:
parent
db09c540d6
commit
83e7cc24ea
@ -97,7 +97,10 @@ def parse_args():
|
|||||||
type=float,
|
type=float,
|
||||||
default=0.5,
|
default=0.5,
|
||||||
help='Opacity of painted segmentation map. In (0, 1] range.')
|
help='Opacity of painted segmentation map. In (0, 1] range.')
|
||||||
parser.add_argument('--local_rank', type=int, default=0)
|
# When using PyTorch version >= 2.0.0, the `torch.distributed.launch`
|
||||||
|
# will pass the `--local-rank` parameter to `tools/train.py` instead
|
||||||
|
# of `--local_rank`.
|
||||||
|
parser.add_argument('--local_rank', '--local-rank', type=int, default=0)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
if 'LOCAL_RANK' not in os.environ:
|
if 'LOCAL_RANK' not in os.environ:
|
||||||
os.environ['LOCAL_RANK'] = str(args.local_rank)
|
os.environ['LOCAL_RANK'] = str(args.local_rank)
|
||||||
|
@ -86,7 +86,10 @@ def parse_args():
|
|||||||
choices=['none', 'pytorch', 'slurm', 'mpi'],
|
choices=['none', 'pytorch', 'slurm', 'mpi'],
|
||||||
default='none',
|
default='none',
|
||||||
help='job launcher')
|
help='job launcher')
|
||||||
parser.add_argument('--local_rank', type=int, default=0)
|
# When using PyTorch version >= 2.0.0, the `torch.distributed.launch`
|
||||||
|
# will pass the `--local-rank` parameter to `tools/train.py` instead
|
||||||
|
# of `--local_rank`.
|
||||||
|
parser.add_argument('--local_rank', '--local-rank', type=int, default=0)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--auto-resume',
|
'--auto-resume',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user