当我想将模型放在 GPU 上时,我收到以下错误:
“RuntimeError:输入和隐藏张量不在同一个设备上,在 cuda:0 找到输入张量,在 cpu 找到隐藏张量”
但是,以上所有内容都已放在 GPU 上:
for m in model.parameters():
print(m.device) #return cuda:0
if torch.cuda.is_available():
model = model.cuda()
test = test.cuda() # test is the Input
Windows 10 服务器
Pytorch 1.2.0 + cuda 9.2
cuda 9.2
cudnn 7.6.3 用于 cuda 9.2
万千封印
元芳怎么了
相关分类