tf.placeholder() 与急切执行不兼容

问题描述

我正在做一个项目,并试图用一些有效的东西替换这段代码。我正在使用 tensorflow 2.5.0 版本,但遇到以下错误

AttributeError: 模块 'tensorflow' 没有属性 'placeholder'

当我使用它时。

tf.compat.v1.placeholder(dtype,shape=None,name=None)

  with tf.compat.v1.variable_scope("regression"):
    x = tf.compat.v1.placeholder(tf.float32,[None,901])
    y,variables = regression(x)

发生此错误

** 运行时错误:tf.placeholder() 与急切执行不兼容。**

请帮我解决

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)