Pytorch:RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

前端 未结 0 1466
天涯浪人
天涯浪人 2021-02-03 11:38

I set my model and data to the same device,

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
net.to(device)


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题