Save a model in TensorFlowSharp
See original GitHub issueI can load python-built models or build models myself but is there currently a good way of saving the whole graph that I do not know of? Right now i am loading a pretrained model, run the init operation and then train it myself which is working fine. However, i would like to save it to disc also, as is possible in python.
Only thing i found was the TFGraph.Save()
method, but i would have to specify what tensors to save and wouldnt know how to reload it then (or if it is even doing what i think its doing).
Any help would be appreciated!
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Save and load models
Model progress can be saved during and after training. This means a model can resume where it left off and avoid long training...
Read more >Save and load models in Tensorflow
Now you can simply save the weights of all the layers using the save_weights() method. It saves the weights of the layers contained...
Read more >Saving and loading models in TensorFlow
The simple way to save the model in TensorFlow is that we can use the built-in function of Tensorflow.Keras.models “Model saving & serialization ......
Read more >Save and load
An entire model can be saved in two different file formats ( SavedModel and HDF5 ). The TensorFlow SavedModel format is the default...
Read more >Save and Load Models with TensorFlow
Save and restore the entire model. To save the model, we can either use the function model.save() or tf.keras.models.save_model(). We also have ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I added these convenience methods to
TFSession
I was frustrated earlier and worked out a temporary solution until the library is in a better state.
This works for what I need, but it can be improved a lot: there is a RestoreV2 function which can restore multiple tensors in a single go, but it wants a parameter named shape_and_slices, I haven’t a clue what formatting it wants the numbers in, and right now I want to throw my laptop out a window.
e.g