The Android example that comes with Tensorflow downloads a protobuf file for InceptionV3 which contains both the graph and the values from the model. In the docs, I could only find how to serialize the graph (tf.Graph.as_graph_def
) or save the variable values with a tf.train.Saver
. How can you save everything to a single file, as done for that example?
Asked
Active
Viewed 3,057 times
3

jfsantos
- 835
- 5
- 20
1 Answers
5
I answered a similar question on this topic: Is there an example on how to generate protobuf files holding trained Tensorflow graphs?
The basic idea is to use tf.import_graph_def()
to replace the variables in the original (training) graph with constants, and then write out the resulting GraphDef
using tf.Graph.as_graph_def()
.
-
Seems to be exactly what I am looking for. Thanks! – jfsantos Jan 09 '16 at 22:19