遇到报错:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1!
原因:在项目中应用了不同序号cuda;
解决办法:找出cuda应用的位置,如果要统一使用cuda:1,则应该写为.cuda(1);
Tips:可通过指令print(.current_device())查看当前使用的cuda;
print(.current_device())