When I load a model:
model = torch.load(modelname)
It raise error:
TypeError: <module '__main__'> is a built-in class
when I save model before, I use the code torch.save(modelname), and I know I should use state_dict recently.
But I have to extract the weights trained before.
The first load step is wrong.
So, what’s the problem?