Repository navigation
Using the PyTorch API, how to save and load models? #130
Answered
by
stes
zhuyuhang4
asked this question in
Q&A
|
Using the PyTorch API, how to save and load models? |
Answered by
stes
Mar 25, 2024
Replies: 1 comment
|
Hi @zhuyuhang4 , multiple options. If you want to implement saving/loading logic your self, To make this a bit more convenient, we implemented loading and saving also directly in the The functions essentially take the If this answers your Q, please mark as an answer :) Otherwise, happy to help further. |
0 replies
Answer selected by
zhuyuhang4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @zhuyuhang4 ,
multiple options.
If you want to implement saving/loading logic your self,
torch.saveandtorch.loador pretty much any other serialization approach (e.g. pickle, joblib, ...) will do. You should save model, optimizer, relevant arguments, etc.To make this a bit more convenient, we implemented loading and saving also directly in the
Solverclass.The functions essentially take the
state_dictof the solver you are running and serialize these.If this answers your Q, please mark as an answer :) Otherwise, happy to help further.