I am having trouble running tf.InteractiveSession()
in Jupyter and I am not sure how to amend it. I am a beginner so I would appreciate some guidance!
Inputting this code here:
import tensorflow as tf
sess = tf.InteractiveSession()
x = tf.constant([[1, 2]])
negMatrix = tf.negative(x)
result = negMatrix.eval()
print(result)
sess.close()
Produces this error message:
**AttributeError**: module 'tensorflow' has no attribute 'InteractiveSession'
Using Tensorflow 2.6.0. you can import tf.compat.v1.InteractiveSession()
Sample working code below
Output