1.test中出现的问题
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
原因:
model没有加载到cuda里面,而数据在cuda中。
解决:
在model.eval()之前加model.cuda()把模型加载到cuda里面
2.问题
TypeError: sigmoid(): argument 'input' (position 1) must be Tensor, not tuple
原因:
tuple中有两个类型的张量
解决:
把prob=model(input)转化为prob,hv=model(input)