sonnet
sonnet copied to clipboard
How to re-create module from loaded model?
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!
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")