美文网首页
AttributeError_ module tensorflo

AttributeError_ module tensorflo

作者: 日常采坑君 | 来源:发表于2020-08-05 11:01 被阅读0次

最近使用tf2.3版本训练模型,因为代码是旧的代码,因此会报错

AttributeError_ module tensorflow has no attribute placeholder

使用云平台或者别的服务器时,如果安装的是高版本的tf(tf2.x),跑比较旧的代码容易出现这种报错。解决方案:注释tf的引用,换为兼容模式。

# import tensorflow as tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior() 

相关文章

网友评论

      本文标题:AttributeError_ module tensorflo

      本文链接:https://www.haomeiwen.com/subject/ppynrktx.html