【报错】macos+python+分布式训练

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'

相关推荐
wjs20241 分钟前
MongoDB 更新集合名
开发语言
monkey_meng5 分钟前
【遵守孤儿规则的External trait pattern】
开发语言·后端·rust
legend_jz29 分钟前
【Linux】线程控制
linux·服务器·开发语言·c++·笔记·学习·学习方法
drebander42 分钟前
使用 Java Stream 优雅实现List 转化为Map<key,Map<key,value>>
java·python·list
tangliang_cn1 小时前
java入门 自定义springboot starter
java·开发语言·spring boot
程序猿阿伟1 小时前
《智能指针频繁创建销毁:程序性能的“隐形杀手”》
java·开发语言·前端
新知图书1 小时前
Rust编程与项目实战-模块std::thread(之一)
开发语言·后端·rust
威威猫的栗子1 小时前
Python Turtle召唤童年:喜羊羊与灰太狼之懒羊羊绘画
开发语言·python
力透键背1 小时前
display: none和visibility: hidden的区别
开发语言·前端·javascript
bluefox19791 小时前
使用 Oracle.DataAccess.Client 驱动 和 OleDB 调用Oracle 函数的区别
开发语言·c#