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,'')
以上这篇TensorFlow查看输入节点和输出节点名称方式就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望
大家多多支持软件开发网。
您可能感兴趣的文章您可能感兴趣的文章:详解TensorFlow查看ckpt中变量的几种方法TensorFlow模型保存/载入的两种方法根据tensor的名字获取
变量的值方式TensorFlow入门使用 tf.train.Saver()保存模型tensorflow实现打印ckpt模型保存下的变量名称及变量值
评论0