DDP报错::nccl error

问题解答:你的GPU最好得是全部的,连续的指定。否则你的rank可能不等于你加载的GPU_id.

问题解决:通过os.environ[“CUDA_VISIBLE_DEVICES”] = "0, 3"来指定GPU,实际多GPU时全用。

import os, sys
os.environ["CUDA_VISIBLE_DEVICES"] = "0, 3"

猜你喜欢

转载自blog.csdn.net/qq_43369406/article/details/130747383
ddp