keras module 'tensorflow' has no attribute 'Session' code example
Example 1: AttributeError: module 'tensorflow' has no attribute 'Session' site:stackoverflow.com
sess = tf.compat.v1.Session()
print(sess.run(hello))
Example 2: module 'tensorflow' has no attribute 'session'
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello = tf.constant('Hello, TensorFlow!')
sess = tf.compat.v1.Session()
print(sess.run(hello))