原文:AttributeError: module 'tensorflow' has no attribute'name_scope' 'placeholder'等问题的解决

问题原因在于在tf 下调用了tf 的API,而tf 中是没有placeholder的。 解决方法: 使用: import tensorflow.compat.v as tftf.disable v behavior 替换: import tensorflow as tf ...

2021-08-09 08:54 0 112 推荐指数:

查看详情

AttributeError: module 'tensorflow' has no attribute 'placeholder'问题

此博客链接:https://www.cnblogs.com/ping2yingshi/p/12920537.html 当你出现这个问题时,说明在tf2下使用了tf1的API。 1.参看版本号是否使用错误。 在pycharm下,找到工程,然后输出下面命令参看版本 ...

Wed May 20 07:56:00 CST 2020 4 54562
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM