报错:
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor
解释:pytorch跑网络模型,输入的类型为CPU数据类型,但是权重类型为GPU类型
解决:把输入类型转换为GPU类型
device = torch.device('cuda:0')
inputs = inputs.to(device)