9

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.

Zach Rattner
  • 20,745
  • 9
  • 59
  • 82

2 Answers2

5

Here's an example of saving and loading

Yaroslav Bulatov
  • 57,332
  • 22
  • 139
  • 197
4

tf.Graph.as_graph_def() retrieves the serialized graph. Then you just write it to a file.