出现这种报错的信息:
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”)
编译通过
出现这种报错的信息:
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”)
编译通过