Tensorflow: Cannot interpret feed_dict key as Tensor

前端 未结 7 1076
清歌不尽
清歌不尽 2020-12-08 14:27

I am trying to build a neural network model with one hidden layer (1024 nodes). The hidden layer is nothing but a relu unit. I am also processing the input data in batches o

7条回答
  •  忘掉有多难
    2020-12-08 14:56

    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.

提交回复
热议问题