tensorflow中的session
2.0版本tf.Session()不能使用
解决办法:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello = tf.constant('hello')
sess = tf.compat.v1.Session()
print(sess.run(hello))
2.0版本tf.Session()不能使用
解决办法:
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello = tf.constant('hello')
sess = tf.compat.v1.Session()
print(sess.run(hello))