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

提示出错如下:

Traceback (most recent call last):File "/MNIST/softmax.py", line 12, in <module>cross_entropy2=tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logits(logits, y_))#dont forget tf.reduce_sum()!!File "C:\python35\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1578, in softmax_cross_entropy_with_logitslabels, logits)File "C:\python35\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1533, in _ensure_xent_args"named arguments (labels=..., logits=..., ...)" % name)
ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

解决方案:

# 这个函数不能按以前的方式进行调用了,只能使用命名参数的方式来调用。原来是这样的:
tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(y, y_))# 修改需要成这样:
tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=y_))

TensorFolw 报错相关推荐

  1. 继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错? springboot 两种方式稳定解决跨域问题

    继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错???springboot 两种方式稳定解决跨域问题! 之前我写了一篇文章,来解决CORS报错 ...

  2. Access to XMLHttpRequest at file from origin ‘null‘ has been blocked by CORS policy谷歌浏览器本地打开项目js文件报错

    Access to XMLHttpRequest at 'file:///xxxxx/PQ.BaseInfo.proto' from origin 'null' has been blocked by ...

  3. go build 编译报错 missing go.sum entry for module providing package

    go build 编译报错 missing go.sum entry for module providing package 解决方法 // 移除未使用的依赖 go mod tidy 再次编译,就可 ...

  4. docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name

    docker 报错: Error response from daemon: Cannot restart container hello: driver failed programming ext ...

  5. mybatis查询报错:com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string

    mybatis查询报错: com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from strin ...

  6. mongo报错:not authorized on bb to execute command { create: \“xxx\“...}

    mongo报错: {"ok" : 0,"errmsg" : "not authorized on bb to execute command { cr ...

  7. restTemplate http请求报错:no suitable HttpMessageConverter found for response type and content type

    报错信息: org.springframework.web.client.UnknownContentTypeException: Could not extract response: no sui ...

  8. 解决gitte提交报错 error: GE007: Your push would publish a private email address.

    错误情况: gitte提交报错,无法提交上去,报错如下: remote: Powered by GITEE.COM [GNK-6.0] remote: error: GE007: Your push ...

  9. JS Uncaught SyntaxError:Unexpected identifier异常报错原因及其解决方法

    最近在写ajax的时候,调用js方法,遇到了Uncaught SyntaxError:Unexpected identifier异常报错,开始搞不清原因,很苦恼. 以为是js方法参数个数和长度的问题, ...

最新文章

  1. 多重for循环如何提速
  2. 微带线特性阻抗计算公式_利用HFSS计算微带线的特性阻抗
  3. Codis 分布式缓存部署
  4. python 企业微信群机器人_企业微信群机器人应用:使用python从网站抓取行业资讯并定时推送...
  5. QT_Astyle 代码管理工具
  6. org.apache.ibatis.binding.BindingException: Parameter '1' not found. Available parameters are [arg3,
  7. javascript学习----window对象的学习与总结
  8. 极客学院 HTML5
  9. 服务器系统日期,系统日期和服务器日期不一致
  10. hyperledger fabric 2.3.3 搭建教程
  11. 饮料自动售货机C++
  12. java中Date计算时间差
  13. 平板电脑做linux服务器,平板电脑安装Ubuntu教程-以V975w为例,Z3735系列CPU通用
  14. BIO NIO AIO 介绍与差别
  15. matlab 旋转向量和旋转矩阵互转
  16. Android学Jni/Ndk 开发记录(一)
  17. opencv-python数字图像处理学习4:对一副图像加噪声(高斯,椒盐等),进行平滑,锐化,观察其图像变化
  18. 新能源汽车高压配电管理(PDU/BDU)
  19. css 鼠标沙漏,CSS3 沙漏动画
  20. 介绍weixin4j实现微信JS-SDK签名算法

热门文章

  1. C语言学习:malloc()函数
  2. Android 为控件设置阴影
  3. 我们正处在“后开源”时代?
  4. 相信什么,生命就走向什么
  5. java 星期几、得周一、得周日、上周、下周、相差、日期工具类
  6. java.util.IdentityHashMap.entrySet()方法实例
  7. shoot for用法
  8. Jmeter----5.1 设置中文
  9. P4313 文理分科 网络流
  10. 通过rsync搭建一个远程备份系统(二)