我导入并编辑了一个冻结图,然后再次保存pb文件,如下所示。 由于解码错误,无法导入“ test2.pb”。 谁能解释一下并修复代码?
谢谢
filename = 'test.pb'
graph_def = tf.GraphDef()
with tf.gfile.GFile(filename, 'rb') as file:
serialized_graph = file.read()
graph_def.ParseFromString(serialized_graph)
# Graph editing
...
# end of graph editig
with tf.Session() as sess:
tf.train.write_graph(graph_def, "./", name='test2.pb')