如何在tensorflow中找到给定的.ckpt.meta文件的输出节点名称 [英] How to find the output node name of given .ckpt.meta file in tensorflow
本文介绍了如何在tensorflow中找到给定的.ckpt.meta文件的输出节点名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
到目前为止,我可以获取给定任何.ckpt.meta文件的所有节点名称的列表,但是我想知道是否存在从列表中找出输出节点名称的系统方法.
So far I can get the list of all node names given any .ckpt.meta file, but I was wondering if there is a systematic way of finding out the output node name from the list.
import tensorflow as tf
tf.reset_default_graph()
with tf.Session() as sess:
saver = tf.train.import_meta_graph('mymodel.ckpt.meta')
graph_def = tf.get_default_graph().as_graph_def()
node_list=[n.name for n in graph_def.node]
推荐答案
您可以尝试:
[n.name for n in tf.get_default_graph().as_graph_def().node]
这篇关于如何在tensorflow中找到给定的.ckpt.meta文件的输出节点名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文