最有效AttributeError: module 'tensorflow' has no attribute 'placeholder'解决办法

在这里插入图片描述
出现上面的错误
将语句 X=tf.placeholder(“float”) Y=tf.placeholder(“float”)
改为:X=tf.compat.v1.placeholder(“float”)
Y=tf.compat.v1.placeholder(“float”)
编译通过
在这里插入图片描述

发布了45 篇原创文章 · 获赞 94 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/D_Katter/article/details/102761628