Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same
Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same。
输入到神经网络的数据类型应该是foat类型的,而不能是双精度。使用
data = data.type(torch.FloatTensor)
就可以了。