List of tensor names in graph in Tensorflow
List of tensor names in graph in Tensorflow
Try this code to print the tensor names in a graph:
import tensorflow as tf def printTensors(pb_file): # read pb into graph_def with tf.gfile.GFile(pb_file, "rb") as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) # import graph_def with tf.Graph().as_default() as graph: tf.import_graph_def(graph_def) # print operations for op in graph.get_operations(): print(op.name) printTensors("path-to-my-pbfile.pb")