RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat2 in method wrapper_mm)
2 解决方法
报错处的最后一行如下,需要在linear.py文件中将其修改。
File "/.../torch/nn/modules/linear.py", line xx,in forward
return F.linear(input, self.weight, self.bias)