标签:tor ref art model 要求 csdn err 意思 obj
这行报错predict = model(Variable(x_train))
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.FloatTensor for argument #4 ‘mat1‘
意思是要求的目标类型是torch.cuda.FloatTensor,但是找到的数据类型是torch.FloatTensor,所以需要在数据类型后面加上.cuda()。将predict = model(Variable(x_train)) 改为predict = model(Variable(x_train.cuda()))
————————————————
ref:https://blog.csdn.net/qq_38410428/article/details/82973895
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.FloatTensor for ar
标签:tor ref art model 要求 csdn err 意思 obj
原文地址:https://www.cnblogs.com/wind-chaser/p/12616865.html