Code Monkey home page Code Monkey logo

Comments (3)

ruohoruotsi avatar ruohoruotsi commented on August 29, 2024

Learning more about the Pytorch model structure, we see that the optimizer’s state_dict is also saved as it contains state and parameters that are updated as the model trains. So this is important for checkpoint models, to resume training, but it is NOT important for the final model, so we can delete this part of the model.

If you trained your model using Adam, you need to save the optimizer state 
dict as well and reload that. Also, if you used any learning rate decay, you need 
to reload the state of the scheduler because it gets reset if you don’t, and you 
may end up with a higher learning rate that will make the solution state oscillate. 
Finally, if you have any dropout or batch norm in your model architecture, and 
you saved your model after a test loop (in which case model.eval() was called), 
make sure to call model.train() before the training loop.

from yoruba-adr.

ruohoruotsi avatar ruohoruotsi commented on August 29, 2024

Fixed in 5781370, new model is 67MB which is still bigger than the recommended 50MB, but at least it still pushes. I should keep track of the history and other sources of bloat in this repo.

from yoruba-adr.

ruohoruotsi avatar ruohoruotsi commented on August 29, 2024

An alternative if you want to use big files on the web, but host elsewhere than somewhere easily curl-able or within the github repo itself. Appreciate the fiddly-ness:

https://medium.freecodecamp.org/how-to-transfer-large-files-to-google-colab-and-remote-jupyter-notebooks-26ca252892fa

from yoruba-adr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.