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

超、凢脫俗 2023-10-15 21:06 144阅读 0赞

详细的报错信息如下:

  1. RuntimeError: Expected all tensors to be on the same device,
  2. but found at least two devices, cuda:0 and cpu!
  3. (when checking argument for argument mat1 in method wrapper_mm)

报错位置

报错的位置是:网络的forward函数(linear.py/forward)
在这里插入图片描述

解决办法

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,144人围观)

还没有评论,来说两句吧...

相关阅读