今天运行Pytorch分布式训练程序时发生了以下报错:
![]()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'torch.distributed.run'
测试后发现装的pytorch里面是有 torch.distributed模块的,当时没有torch.distributed.run
![]()
原来是pytorch装的老版本,上面的 torch.distributed.run 是最新的版本里的
在老版本里对应的是 torch.distributed.launch
总结:将torch.distributed.run 换成 torch.distributed.launch 即可
在旧版Pytorch中遇到`torch.distributed.run`缺失的问题,实际上该功能由`torch.distributed.launch`提供。确保使用正确的方法启动分布式训练是解决此类问题的关键。
978

被折叠的 条评论
为什么被折叠?



