Downloads/loca-main/train.py
Traceback (most recent call last):
File "/Users/dearr/Downloads/loca-main/train.py", line 222, in <module>
train(args)
File "/Users/dearr/Downloads/loca-main/train.py", line 32, in train
world_size = int(os.environ['WORLD_SIZE'])
File "/Users/dearr/anaconda3/envs/pytorch/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'WORLD_SIZE'
分布式训练出现这个错误的解决办法:KeyError:‘RANK‘_keyerror: 'rank-CSDN博客
(pytorch) (base) dearr@dearrdeMacBook-Air loca-main % /Users/dearr/anaconda3/envs/pytorch/bin/python /Users/dearr/
Downloads/loca-main/train.py
Traceback (most recent call last):
File "/Users/dearr/Downloads/loca-main/train.py", line 224, in <module>
train(args)
File "/Users/dearr/Downloads/loca-main/train.py", line 36, in train
gpu = int(os.environ['LOCAL_RANK'])
File "/Users/dearr/anaconda3/envs/pytorch/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'LOCAL_RANK'
(pytorch) (base) dearr@dearrdeMacBook-Air loca-main % export LOCAL_RANK=0
(pytorch) (base) dearr@dearrdeMacBook-Air loca-main % /Users/dearr/anaconda3/envs/pytorch/bin/python /Users/dearr/Dow
nloads/loca-main/dearRongerr.py
Traceback (most recent call last):
File "/Users/dearr/Downloads/loca-main/dearRongerr.py", line 25, in <module>
print(os.environ['RANK'])
File "/Users/dearr/anaconda3/envs/pytorch/lib/python3.8/os.py", line 675, in __getitem__
raise KeyError(key) from None
KeyError: 'RANK'