New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to resume training ? #33
Comments
After instantiating a model, you can load the .pth file after that. |
@akhil451 Thanks for the answer. In addition, to resume the training from where exactly it was, one usually needs to save and load the optimizer (especially for Adam). https://pytorch.org/tutorials/beginner/saving_loading_models.html |
@chenyangh @akhil451 Thanks |
@chenyangh how about fine tuning the u2net.pth model by loading optimizer ? How to do load the optimizer for pretrained model ? |
@muhammadabdullah34907 I don't think we have saved optimizer during the training. If you simply load the released pre-trained model and keep training it with a newly initialized Adam optimizer, it may diverge in the beginning. |
@chenyangh how about saving the optimizer in one .pth together with the model state like this ?
|
Hello,
how to resume training on a saved .pth ?
The text was updated successfully, but these errors were encountered: