InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor
From your error message, it looks like you are using IPython. One pitfall when using IPython to build a TensorFlow model is that functions like?tf.merge_all_summaries()?will remember every summary created in the current session, including cells that failed with an error. This is a result of TensorFlow using a?default graph?to collect all of the operations, summaries, etc. that are created in a process, unless you specify the graph explicitly. I suspect that your call to?tf.merge_all_summaries()?is returning more than the three histogram summaries that you created in your code, and the older ones will have a dependency on a?previously created?placeholder.
There are two main ways that you could fix that. The simplest is to explicitly merge the summaries, rather than using?tf.merge_all_summaries():
An alternative would be to set an?explicit default graph?before constructing your model. This is awkward if you want to split your model across multiple IPython cells, but should also work:
總結(jié)
以上是生活随笔為你收集整理的InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: placeholder 与variabl
- 下一篇: U盘制作linux启动盘