Hello ,I’m trying to load a trained model’s weights, but when i load it my AI restart learning from the beginning, like it didn’t take in consideration the weights.
My code for saving weights :
torch.save({‘net’:self.net.state_dict(),
‘optim’:self.optimizer.state_dict(),
},ai.bak)
And for loading :
checkpoint=torch.load(self.find_file(‘ai.bak’))
self.net.load_state_dict(checkpoint[‘net’])
Help me please!