DDP报错::RuntimeError: Expected all tensors to be on the same device, but found at least two devic

DDP报错

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

产生原因:未知。

解决方法:反正你得在模型初始化后就将模型放到GPU上,再加载模型参数。

猜你喜欢

转载自blog.csdn.net/qq_43369406/article/details/130745766