function ( lambda x : model ( x )) full_model = full_model. # Convert Keras model to ConcreteFunctionįull_model = tf. To train and export the model, please run the following command in the terminal. In addition, the model would also be frozen and saved as frozen_graph.pb in the frozen_models directory. The model would be saved as SavedModel in the models directory for completeness. We would train a simple fully connected neural network to classify the Fashion MNIST data. It was modified from the official TensorFlow 2.x Fashion MNIST Classification example. This sample code was available on my GitHub. In this blog post, I am going to show how to save, load, and run inference for frozen graphs in TensorFlow 2.x. However, since TensorFlow 2.x removed tf.Session, freezing models in TensorFlow 2.x had been a problem for most of the users. TensorFlow 1.x provided an interface to freeze models via tf.Session, and I previously had a blog on how to use frozen models for inference in TensorFlow 1.x. Frozen graphs are commonly used for inference in TensorFlow and are stepping stones for inference for other frameworks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |