这两种方法之间的打印图形节点有什么区别? 似乎操作的打印顺序不同。
def print_graph_v1():
with open(input_model_filepath, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
for node in graph_def.node:
print('-'*60)
print(node.name)
def print_graph_v2():
with tf.gfile.GFile(input_model_filepath, "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, name='')
for op in graph.get_operations():
print('-' * 60)
print(op.name)