这是我的主要代码,但我不知道如何解决问题?
c.getImageData
答案 0 :(得分:3)
您正在加载检查点作为状态字典,它不是 nn.module 对象。
checkpoint = './checkpoints/fcn_model_5.pth'
model = your_model() # a torch.nn.Module object
model.load_state_dict(torch.load(checkpoint ))
model = model.to(device)