The inception net in the Android Tensorflow Demo stores the model as a protobuf file (tensorflow_inception_graph.pb). I'd like to replace this network with another one.
Is there documentation or an example somewhere on how to convert a trained TensorFlow network in Python to .pb
? I'm aware of TensorFlow's Saver but this seems to be used to save intermediate training state. Not sure how it works if the model is already trained.
TensorFlow protocol buffer. Since protocol buffers use a structured format when storing data, they can be represented with Python classes. In TensorFlow, the tf. train. Example class represents the protocol buffer used to store data for the input pipeline.
StatefulPartitionedCall is an op that does a simple function call in TF. Our converter doesn't normally have to deal with it since the optimizer we run before conversion automatically inlines most function calls.
Here's an example of saving and loading
tf.Graph.as_graph_def()
retrieves the serialized graph. Then you just write it to a file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With