测试以下代码:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello=tf.constant("hello")
sess = tf.compat.v1.Session()
print(sess.run(hello))
原因是你的tensorflow版本是2.0以上的
测试以下代码:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello=tf.constant("hello")
sess = tf.compat.v1.Session()
print(sess.run(hello))
原因是你的tensorflow版本是2.0以上的