我有一个protobuf文件network.pb
,它是从运行tensorflow 1.10的脚本创建的,我想将其加载并保存为标准的SavedModel格式(https://www.tensorflow.org/guide/saved_model),该文件我发现更容易使用。我已经使用下面的代码成功加载了该图,但是现在我已经知道如何处理该图了:
def load_graph(frozen_graph_filename):
with tf.gfile.GFile(frozen_graph_filename, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
with tf.Graph().as_default() as graph:
tf.import_graph_def(
graph_def,
input_map=None,
return_elements=None,
name="prefix",
op_dict=None,
producer_op_list=None
)
return graph
graph = load_graph('./network.pb')
任何指针将不胜感激!