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 re-create module from loaded model? #184

Open
vishnukmd7 opened this issue Jul 25, 2020 · 1 comment
Open

How to re-create module from loaded model? #184

vishnukmd7 opened this issue Jul 25, 2020 · 1 comment

Comments

@vishnukmd7
Copy link

Hi,
I'm extremely new to both TF and Sonnet.

I was trying to figure out how to save and load a trained network. I was following what was written in https://github.com/deepmind/sonnet#tensorflow-saved-model , but cant figure out how to regenerate a my_module object, with the weights from the loaded model.

Thanks!

@siAyush
Copy link

siAyush commented Oct 24, 2020

Hi,
You can save the model by this:
tf.saved_model.save(my_model, "the_saved_model")
And for loading your model back use this:
new_model = tf.saved_model.load("the_saved_model")

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