Python 在Jupyter中运行tf.InteractiveSession()时出现问题
我在Jupyter中运行Python 在Jupyter中运行tf.InteractiveSession()时出现问题,python,tensorflow,jupyter,interactive,Python,Tensorflow,Jupyter,Interactive,我在Jupyter中运行tf.InteractiveSession()时遇到问题,我不知道如何修改它。我是一个初学者,所以我希望得到一些指导 在此处输入此代码: import tensorflow as tf sess = tf.InteractiveSession() x = tf.constant([[1, 2]]) negMatrix = tf.negative(x) result = negMatrix.eval() print(result) sess.close() 生成以下
tf.InteractiveSession()
时遇到问题,我不知道如何修改它。我是一个初学者,所以我希望得到一些指导
在此处输入此代码:
import tensorflow as tf
sess = tf.InteractiveSession()
x = tf.constant([[1, 2]])
negMatrix = tf.negative(x)
result = negMatrix.eval()
print(result)
sess.close()
生成以下错误消息:
**AttributeError**: module 'tensorflow' has no attribute 'InteractiveSession'
您使用的是什么版本的tensorflow和jupyter?回答了您的问题吗?如果使用tensorflow v 1.13.2解决了,请告诉我这是否回答了您的问题?