详细的报错信息如下: 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 mat1 in method wrapper_mm) 报错位置 报错的位置是:网络的forward函数(linear.py/forward) 解决办法