Tensorflow CIFAR-10训练例子报错解决

大部分是Api版本问题:

AttributeError: 'module' object has no attribute 'SummaryWriter'

tf.train.SummaryWriter改为:tf.summary.FileWriter

AttributeError: 'module' object has no attribute 'summaries'

tf.merge_all_summaries()改为:summary_op = tf.summaries.merge_all()

tf.histogram_summary(var.op.name, var)
AttributeError: 'module' object has no attribute 'histogram_summary'

改为:  tf.summaries.histogram()

tf.scalar_summary(l.op.name + ' (raw)', l)
AttributeError: 'module' object has no attribute 'scalar_summary'

tf.scalar_summary('images', images)改为:tf.summary.scalar('images', images)

tf.image_summary('images', images)改为:tf.summary.image('images', images)

ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

cifar10.loss(labels, logits) 改为:cifar10.loss(logits=logits, labels=labels)

cross_entropy = tf.nn.softmax_cross_entropy_with_logits(
        logits, dense_labels, name='cross_entropy_per_example')

改为:

cross_entropy = tf.nn.softmax_cross_entropy_with_logits(
        logits=logits, labels=dense_labels, name='cross_entropy_per_example')

TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. Use `if t is not None:` instead of `if t:` to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.

if grad: 改为  if grad is not None:

ValueError: Shapes (2, 128, 1) and () are incompatible

concated = tf.concat(1, [indices, sparse_labels])改为:

concated = tf.concat([indices, sparse_labels], 1)

Tensorflow CIFAR-10训练例子报错解决相关推荐

  1. 姿态估计1-02:HR-Net(人体姿态估算)-官方模型训练测试-报错解决

    以下链接是个人关于HR-Net(人体姿态估算)所有见解,如有错误欢迎大家指出,我会第一时间纠正.有兴趣的朋友可以加微信:17575010159 相互讨论技术.若是帮助到了你什么,一定要记得点赞!因为这 ...

  2. 导入keras训练好的模型报错解决OSError: Unable to open file (unable to open file: name = ‘model_3.h5’)

    导入keras训练好的模型报错解决) 开心撒花 切入正题 开心撒花 第一次写博客,想分享记录一下自己写程序.跑程序过程中的问题和收获.哈哈哈哈 开心. Markdown编辑器 第一次用感觉很友好啊.喜 ...

  3. 已解决:导入keras(tf)训练好的模型报错解决OSError: Unable to open file (unable to open file: name = ‘model_3.h5’)

    1.场景 导入keras训练好的模型报错解决 OSError: Unable to open file (unable to open file: name = 'model_3.h5') 2.解决方 ...

  4. 报错解决:ResourceExhaustedError: OOM when allocating tensor with shape

    报错解决:ResourceExhaustedError: OOM when allocating tensor with shape 早上在使用tensorflow时遇到如下报错: Traceback ...

  5. Linux | Ubuntu 20.04安装ipopt和cppAD | 安装全流程+报错解决

    文章目录 参考资料 1. Ipopt安装 1. 方式1: 命令行安装 2. 方式2:源码安装 3. 方式3:源码安装 4. Ipopt测试 5. 报错修复 2. CppAD安装 1. 方式1:命令行安 ...

  6. 从零开始在ubuntu上安装和使用k8s集群及报错解决

    文章目录 安装docker 安装kubernetes 配置k8s集群 配置虚拟机网络 配置Master节点的k8s网络 拉取k8s需要的镜像 启动 kubeadm 和 kubelet 配置 node节 ...

  7. Linux/ubuntu 安装 redis 4.0报错解决:redis-server.service: Can't open PID file /var/run/redis/redis-server.

    此文首发于我的个人博客:Linux/ubuntu 安装 redis 4.0报错解决:redis-server.service: Can't open PID file /var/run/redis/r ...

  8. Reids报错解决:Job for redis-server.service failed because the control process exited with error code.

    此文首发于我的个人博客:Reids报错解决 Job for redis-server.service failed because the control process exited with er ...

  9. 报错解决:InvalidArgumentError: Received a label value of 101 which is outside the valid range of [0, 101

    报错解决:InvalidArgumentError: Received a label value of 101 which is outside the valid range of [0, 101 ...

最新文章

  1. Centos7下安装Docker
  2. FPA笔记三 数据功能的识别
  3. 7-5 顺序存储的二叉树的最近的公共祖先问题(25 分)
  4. 笔记-项目质量管理-复习要点
  5. swagger openapi开放平台 pyhton3.7实现http发送请求,pyhon中代码中发送http请求控制4g物联网开关
  6. JS与Asp.Net的传值
  7. mysql 慢查询日志记录
  8. 实战爬虫:python爬虫学习笔记之爬取搜狗|微信文章——动态网页爬取
  9. 2012-08-20 → 2012-08-26 周总结
  10. sqlserve 热备用状态更新_什么是核心交换机的链路聚合、冗余、堆叠、热备份
  11. 数据通信与网络技术之网络基础
  12. keras python3.7_主页 - Keras 中文文档
  13. 吴昂雄回应Arm中国控制权争夺:Arm罢免我无效
  14. Could not find a version that satisfies the requirement pytz (from django)
  15. 关于一个微信公众号:原子与分子模拟
  16. 锁定计算机屏幕的快捷键是什么,锁住电脑屏幕的快捷键_打开电脑屏幕的快捷键...
  17. 梦游计算机,传承与奉献!《梦幻西游》电脑版《梦游敦煌》完结
  18. 实时商业智能BI(二):合理的ETL架构设计实现准实时商业智能BI
  19. PPT的备注区字体太小,还改不了?
  20. 基础算法-支持向量机

热门文章

  1. 怎么重置mysql密码是多少钱_mysql怎么重置密码
  2. Java中使用BigDecimal进行浮点数精确计算 超大整数 浮点数等计算,没有数位限制...
  3. 使用 Gatsby.js 搭建静态博客 EX 使用语雀发布到博客
  4. MySQL学习(十一)
  5. CAD绘图控件VectorDraw web library (javascript)更新至v7.7014.1.0丨75折优惠
  6. 企业级监控ZABBIX深度实践安装部分
  7. Java 内部类分析
  8. 字符串字符数组和基本类型的相互转换
  9. 谷歌应用引擎新增PHP支持
  10. [每周软件]:Cucumber:未完待续的原因