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 –