您甚至不必创建会话即可查看图中的所有操作名称。为此,您只需要获取一个默认图形tf.get_default_graph()
并提取所有操作: .get_operations
。每个操作都有许多字段 ,您需要的是名称。
这是代码:
import tensorflow as tf
a = tf.Variable(5)
b = tf.Variable(6)
c = tf.Variable(7)
d = (a + b) * c
for i in tf.get_default_graph().get_operations():
print i.name
0
Tensorflow中的图形对象具有一种称为“ get_tensor_by_name(name)”的方法。反正有没有得到有效张量名称的列表?
如果不是,那么有人从这里知道预训练模型inception-v3的有效名称吗?从他们的示例pool_3开始,它是一个有效的张量,但是所有这些列表都很好。我看了一下所提到的文件 ,其中一些层似乎与表1中的大小相对应,但并非全部。