Saving the whole model vs only state_dict #1185
Unanswered
grolysaini
asked this question in
Q&A
Replies: 1 comment
-
Hi, model.load_state_dict(torch.load("weights.pth")) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When loading a model's
state_dict
which has been saved earlier, we have to first create an instance of the model. Would that mean that you have to have the model in code somewhere? i.e. The model must be defined somewhere to use it? WillTorchScript
avoid this requirement of having to have the model class available before loading the model/state_dict?Beta Was this translation helpful? Give feedback.
All reactions