Hi ,
I’m having trouble while loading the densenet pretrained model. Did following steps to save and load:
save:
checkpoint = {‘state_dict’: model.state_dict()}
torch.save(checkpoint, ‘checkpoint_densenet.pth’)
load:
state_dict = torch.load(‘checkpoint_densenet.pth’)
model.load_state_dict(state_dict)
and got following error when running:
RuntimeError: Error(s) in loading state_dict for DenseNet:
Missing key(s) in state_dict: …
Unexpected key(s) in state_dict: “state_dict”.
Am i doing it right? or whats missing?
Regards
Ranjit