Skip to content
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 save the model? #96

Open
philipwelia opened this issue Sep 25, 2021 · 2 comments
Open

How to save the model? #96

philipwelia opened this issue Sep 25, 2021 · 2 comments

Comments

@philipwelia
Copy link

I want to save models during training as the state_dict() function in pytorch. How can?

@AlirezaAzadbakht
Copy link

you can look at each ML or DL model as a set of parameters, if you completely know the model which you are working with, you can manually save those parameters, if not, a simple way to save ML models is using joblib library:

import joblib 
joblib.dump(model, 'model.pkl')

and simply load it:

model = joblib.load('model.pkl')

@philipwelia
Copy link
Author

philipwelia commented Oct 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants