【发布时间】:2018-10-05 07:19:15
【问题描述】:
我想在 Jupyter 笔记本中使用 tensorflow。但是,运行
import tensorflow as tf
在 Jupyter 笔记本中立即触发弹出窗口:
内核似乎已经死了。它会自动重启。
此问题仅在更新到 tensorflow 1.7 后才开始。我已经有几个星期没有使用 tensorflow,所以这也可能是由于使用 Python 3.6 更新了 anaconda 5.1。
我使用的是 2010 年中配备“High Sierra 10.13.4”的 MacBookPro。使用 Python 3.6 删除和重新安装 anaconda 5.1,然后通过安装 tensorflow(而不是单个其他库)
pip3 install --upgrade tensorflow
没有解决问题。我不使用孤立的环境。 “anaconda3”文件夹不在我的主文件夹中,而是直接在“Macintosh HD”中。
在重新安装 anaconda 之前,我通过这些说明将其删除 https://docs.anaconda.com/anaconda/install/uninstall。我也没有尝试在 Jupyter 之外运行 tensorflow,只是因为我不知道如何。但即使我这样做了,我仍然想使用 Jupyter。
【问题讨论】:
-
内存不足?
-
8GB。导入 tensorflow 应该绰绰有余。它之前确实有效(早期的 tensorflow 和 anaconda 版本)。
-
在普通的旧 python shell 中导入会发生什么?
-
在 python shell 中输入“import tensorflow as tf”会导致“=================== RESTART: Shell ====== ============="和变量的损失。
-
我在 python REPL 上没有看到类似“RESTART: Shell”的东西。你能发布完整的细节吗?
标签: python tensorflow anaconda jupyter-notebook