1. 是否全部用的pytorch内置函数
2.高斯核参数均值μ和sigma是否设置合理
3.内存报错:batch size, pin_memory=False
4. pip install torchsnooper 在函数前加装饰器
@torchsnooper.snoop()
可以打印该函数的每行代码输出内容。
5.TypeError: add received an invalid combination of arguments - got (torch.cuda.FloatTensor), but expected one of: * (float value)
可能是有些tensor在GPU,有些在CPU
6.AttributeError: 'torch.Size' object has no attribute 'size' torch0.1.12版本
torch.expand_as(x.size) →torch.expand(x.size)
7.torch.load 'utf-8' codec can't decode byte 0xae in position 3:
Solutions:
loaded_state_dict = torch.load('./runs1/Resnet50/model_best.pth.tar')
→ loaded_state_dict = torch.load('./runs1/Resnet50/model_best.pth.tar', encoding='latin1')
....
持续更新