以下两种方式都不好使用:目前只是找到原因,等我找到方案再来完善。

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():

  1. weights_summary = tf.histogram_summary("weights", W)
  2. biases_summary = tf.histogram_summary("biases", b)
  3. y_summary = tf.histogram_summary("y", y)
  4. merged = tf.merge_summary([weights_summary, biases_summary, y_summary])

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:

  1. # Sets a new default graph, and stores it in `g`.
  2. with tf.Graph().as_default() as g:
  3. x = tf.placeholder(tf.float32, [None, 784])
  4. # ...
  5. # Summaries are added to `g`.
  6. _ = tf.histogram_summary("weights", W)
  7. _ = tf.histogram_summary("biases", b)
  8. _ = tf.histogram_summary("y", y)
  9. # ...
  10. # `merged` contains only summaries from `g`.
  11. merged = tf.merge_all_summaries()

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor相关推荐

  1. BUG InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Pl

    为了想看一段代买的Tensor,加入了 sess = tf.Session()print(sess.run(self.embedded_chars)) 然后就报错: InvalidArgumentEr ...

  2. InvalidArgumentError: You must feed a value for placeholder tensor ‘conv2d_12_input‘ with dtype floa

    InvalidArgumentError: You must feed a value for placeholder tensor 'conv2d_12_input' with dtype 在jup ...

  3. 坑 之 You must feed a value for placeholder tensor ‘label_input‘ with dtype float and shape

    首先检查图中的tf.placeholder(),你在sess.run的时候是否feed满足dtype和shape的数据.如果你这两项都没错的话,那么你极有可能犯了重命名的错误,这里指的是使用占位符生成 ...

  4. tensorflow错误:InvalidArgumentError (see above for traceback): Cannot assign a device for operation

    一.错误 InvalidArgumentError (see above for traceback): Cannot assign a device for operation 'shuffle_b ...

  5. tensorflow报InvalidArgumentError (see above for traceback): Conv2DSlowBackpropInput

    在使用TensorFlow求解转置卷积(反卷积)的时候,我们需要调用tf.nn.conv2d_transpose方法,在计算反卷积的时候,报了如下错误 InvalidArgumentError (se ...

  6. 报错InvalidArgumentError (see above for traceback): Restoring from checkpoint failed

    报错详情: 使用faster-rcnn训练自己的模型,下载使用别人的代码 这份代码 运行python tools/demo.py报错 如下: Traceback (most recent call l ...

  7. The value of a feed cannot be a tf.Tensor object.

    使用tf.data.Dataset时出现报错"The value of a feed cannot be a tf.Tensor object." session.run(trai ...

  8. InvalidArgumentError (see above for traceback): Invalid JPEG data, size 75244

    除了这一句之外上面应该还有一句:Not a JPEG file: starts with 0x47 0x49 starts with 0x47 0x49说明这是一张gif图像,starts with ...

  9. 简单完整地讲解tensorflow模型的保存和恢复

    http://blog.csdn.net/liangyihuai/article/details/78515913 在本教程主要讲到: 1. 什么是Tensorflow模型? 2. 如何保存Tenso ...

最新文章

  1. 两帧点云刚性配准的ICP算法
  2. Mac没有winnt格式_8款优秀软件,让你使用mac更舒适
  3. 一个通用的makefile写法,自动推导文件的依赖关系
  4. 中秋逢国庆 | 盛世华诞 阖家团圆
  5. mysql组合索引与字段顺序
  6. JS实现new关键字的功能
  7. python装饰器用法
  8. 【PADS】用PADS画PCB
  9. 【原创】matlab 2010的下载和安装
  10. c语言解线性方程组矩阵形势,c语言解线性方程组.docx
  11. 【系】微信小程序云开发实战坚果商城-前端之分类实现
  12. Excel 常用技巧目录
  13. 微信小程序腾讯服务器地址要购买吗,微信小程序JavaScript SDK
  14. 初识Git与GitHub和使用案例
  15. 关于AD前面的电压跟随器
  16. 《GPU高性能编程》——gl_helper.h
  17. 新一代人工智能知识体系大全
  18. 计算机控制电机启动接线图,详解单相电机电容接线图
  19. 搜索 系统通知服务器,博图软件 搜索在线设备 提示“到通讯服务器连接已中止”-工业支持中心-西门子中国...
  20. python for循环写在一行_python开发如何将嵌套 for 循环写成单行?

热门文章

  1. linux usb 触摸屏驱动,请教大家一个linux下的usb触摸屏驱动的问题
  2. java多线程必杀技_Java技术大牛必备25个必杀技你都知道吗
  3. PHP超实用的函数总结整理
  4. c在linux中怎样执行文件,如何在Linux中编译和运行C/C+程序,简单示例教懂你
  5. go mysql slave_【Golang+mysql】记一次mysql数据库迁移(一)
  6. android 3d渲染动画效果吗,Android如何实现3D效果
  7. 中兴存储服务器 操作系统,中兴新支点服务器操作系统:企业级的国内服务器操作系统...
  8. 【Node.js】serve 实现目录浏览服务
  9. 审批流程展示html,Web企业在线审批流程系统
  10. jvm学习笔记(一)