tf.get_tensor_by_name(),该图的某些节点不存在

时间:2018-11-12 03:37:24

标签: tensorflow graph-theory

这些是一些张量和类似的运算符:

x = tf.placeholder(....., name='input')
y = tf.placeholder(....., name='label')
...
fc_droop = tf.nn.dropout(....., name='fc1')
...
y_pred = tf.nn.softmax(....., name='predict')
...
train_step = tf.train.AdamOptimizer(lr).minimize(loss, name='train_step')

训练完成后,我将其另存为模型。 但是当我还原它并通过tf.get_tensor_by_name('xx:0')获取图节点时,“输入”,“标签”,“预测”都可以,但是“ fc1”,“ train_step”得到了错误:

the name 'xx' refers to a tensor which does not exist

请问是什么问题

0 个答案:

没有答案