Closed testingshanu closed 5 years ago
solved it by changing the way how the model is saved.
How did you change the way the model is saved @testingshanu ?
How did you change the way the model is saved @testingshanu ?
https://pytorch.org/docs/stable/notes/serialization.html#recommend-saving-models In the official Pytorch docs, there are two ways to save the model:
torch.save(the_model.state_dict(), PATH)
which saves and loads only the model parameterstorch.save(the_model, PATH)
which saves and loads the entire modelI think you should use the second way to save the model
Hey, I was trying to resume the training from the saved weights. However a problem occurs while loading the weights stating :
KeyError: 'weight'
from DSFD_vgg.py
When I print out the keys in the saved weights, I could not find both weight and epochs as mentioned in the code.
Any solution to solve it?
Thank you,