how to fix : module 'tensorflow' has no attribute 'Session'
13,520
From the official doc try the following:
# Build a graph.
a = tf.constant(5.0)
b = tf.constant(6.0)
c = a * b
# Launch the graph in a session.
sess = tf.compat.v1.Session()
# Evaluate the tensor `c`.
print(sess.run(c))
Author by
Admin
Updated on June 04, 2022Comments
-
Admin almost 2 years
import tensorflow as tf a=tf.constant(2) b=tf.constant(3) c=a+b sess=tf.Session(c) sess.run()
I got the error message module 'tensorflow' has no attribute 'Session'