问题描述
在存储模型作为protobuf的文件()。我想替换这个网络与另一个。
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.
是否有文件或一个例子某处如何在Python训练有素的TensorFlow网络转换为 .pb
?我知道TensorFlow的节电器但这似乎是用于保存中间训练状态。不知道它是如何工作如果模型已经训练。
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.
推荐答案
tf.Graph.as_graph_def()
检索序列图。然后你只是把它写入一个文件。
tf.Graph.as_graph_def()
retrieves the serialized graph. Then you just write it to a file.
这篇关于转换训练有素Tensorflow模型的Protobuf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!