jupyter中tensorflow的tf.summary.merge_all()的问题

问题:在jupyter下采用tf.summary.merge_all() 会出现以下问题。


InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'inputs/x' with dtype float and shape [?,1]
	 [[Node: inputs/x = Placeholder[dtype=DT_FLOAT, shape=[?,1], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

参照网址:https://stackoverflow.com/questions/35114376/error-when-computing-summaries-in-tensorflow
中部分网友解答。

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.

 

得到的解决方案如下:上述中提到like tf.merge_all_summaries() will remember every summary created in the current session, including cells that failed with an error.

因此运行之前restart kernel 即可。

 

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值