1
最近,我在Jupyter/IPython笔记本中使用TensorFlow中的InteractiveSession出现错误。问题是如此直截了当地重建,我的整个代码是:使用TensorFlow和Jupyter实例化InteractiveSession时出现错误
import tensorflow as tf
sess = tf.InteractiveSession()
sess.graph
,输出是:
Exception ignored in: <bound method BaseSession.__del__ of <tensorflow.python.client.session.InteractiveSession object at 0x11a4e89b0>>
Traceback (most recent call last):
File "/Users/.../anaconda/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 140, in __del__
self.close()
File "/Users/.../anaconda/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in close
self._default_session.__exit__(None, None, None)
File "/Users/brad/anaconda/lib/python3.5/contextlib.py", line 66, in __exit__
next(self.gen)
File "/Users/.../anaconda/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3215, in get_controller
assert self.stack[-1] is default
AssertionError:
Out[3]:
<tensorflow.python.framework.ops.Graph at 0x10685dc50>
使图形呼叫的作品,但我无法解释这个错误或摆脱的。
您正在使用哪个版本的TensorFlow?最近调整了交互式会话析构函数代码,并且我还没有能够用最新版本重新创建它。 – mrry
我正在使用版本v0.8.0 –