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

add Keras/klab-13-3-mnist_save_restore.py #141

Closed
skyer9 opened this issue Apr 29, 2017 · 3 comments
Closed

add Keras/klab-13-3-mnist_save_restore.py #141

skyer9 opened this issue Apr 29, 2017 · 3 comments

Comments

@skyer9
Copy link
Contributor

skyer9 commented Apr 29, 2017

https://gist.github.com/skyer9/d4cc48e7e0182f198a8b8d1a388f248f

this file describes how to save/load model.

@kkweon
Copy link
Collaborator

kkweon commented Apr 30, 2017

Looks good.
But in Keras, it's preferred to use full model save/load instead of saving/loading weights.

  • Full model save/load for regular jobs
  • Weight save/load is specifically designed for transfer learning.

The reason for this preference is that

  1. we don't have to define a model architecture when we use a full model load.
  2. model epoch is taken care of automatically. For advanced optimizers like Adam, RMSProp, it's important to keep the number of steps.

So, I think it's a good idea to write a few comments about each method.

from keras.models import load_model

#save
model.save(filepath) # instead of model.save_weights()

#load
model = load_model(filepath) # instead of model.load_weights()

@skyer9
Copy link
Contributor Author

skyer9 commented Apr 30, 2017

in Keras, simple is best.
you're suggestion is good.
i will look you're suggestion.

@github-actions
Copy link

github-actions bot commented Dec 7, 2019

This issue is stale because it has been open 30 days with no activity. Leave a comment or this will be closed in 5 days.

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

No branches or pull requests

2 participants