The error message TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("...", dtype=dtype) is not an element of this graph
can also arise in case you run a session outside of the scope of its with
statement. Consider:
with tf.Session() as sess:
sess.run(logits, feed_dict=feed_dict)
sess.run(logits, feed_dict=feed_dict)
If logits
and feed_dict
are defined properly, the first sess.run
command will execute normally, but the second will raise the mentioned error.