Is it possible to get the model weights from optimizer

I accidentally only saved the optimizer and forgot to save the model.state_dict(). Is it possible to rebuild the model.state_dict() with the weights saved in the optimizer? Any idea is helpful.


I’m afraid it is not possible no. The optimizer explicitly does not save model weights to avoid saving them twice.