TensorFlow는 입력 및 출력 노드 이름을 보려면

TensorFlow 입력 노드 이름 input_name을 정의합니다 : 

  with tf.name_scope('input'):
    bottleneck_input = tf.placeholder_with_default(
        bottleneck_tensor,
        shape=[batch_size, bottleneck_tensor_size],
        name='Mul')

데이터베이스 입력 및 출력 노드 내부 TensorFlow보기 PB :

import tensorflow as tf
import os

model_dir = './tmp/'
model_name = 'output_graph.pb'

def create_graph():
    with tf.gfile.FastGFile(os.path.join(
            model_dir, model_name), 'rb') as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())
        tf.import_graph_def(graph_def, name='')

create_graph()
tensor_name_list = [tensor.name for tensor in tf.get_default_graph().as_graph_def().node]
for tensor_name in tensor_name_list:
    print(tensor_name,'\n')

 

 

게시 된 147 개 원래 기사 · 원 찬양 146 · 전망 770 000 +

추천

출처blog.csdn.net/miao0967020148/article/details/89434253