解决方法1
将 python -m torch.distributed.launch 更改为 torchrun
解决方法2
将 python -m torch.distributed.launch 更改为 python -m torch.distributed.run
举个例子
原代码
python -m torch.distributed.launch train.py
更改为
torchrun train.py
将 python -m torch.distributed.launch 更改为 torchrun
将 python -m torch.distributed.launch 更改为 python -m torch.distributed.run
原代码
python -m torch.distributed.launch train.py
更改为
torchrun train.py