简体   繁体   English

导入tensorflow 1.7时Python内核死亡

[英]Python kernel dies when importing tensorflow 1.7

I want to use tensorflow insinde a Jupyter notebook. 我想使用tensorflow insinde Jupyter笔记本。 However, running 但是,跑步

import tensorflow as tf

in a Jupyter notebook immediately triggers a pop-up: 在Jupyter笔记本中立即触发弹出窗口:

The kernel appears to have died. 内核似乎已经死了。 It will restart automatically. 它会自动重启。

This issue only began after updating to tensorflow 1.7. 此问题仅在更新为tensorflow 1.7后才开始。 I had not used tensorflow for a few weeks so it might also be due to an update to anaconda 5.1 with Python 3.6. 我没有使用tensorflow几周,所以它也可能是由于使用Python 3.6更新了anaconda 5.1。

I use a Mid-2010 MacBookPro with "High Sierra 10.13.4". 我使用2010年中期的MacBookPro和“High Sierra 10.13.4”。 Removing and reinstalling anaconda 5.1 with Python 3.6, followed by installation of tensorflow (and not a single other library) via 使用Python 3.6删除并重新安装anaconda 5.1,然后通过安装tensorflow(而不是单个其他库)

pip3 install --upgrade tensorflow

did not resolve the issue. 没有解决问题。 I do not use an isolated environment. 我不使用孤立的环境。 The "anaconda3" folder is not in my home folder but directly in "Macintosh HD". “anaconda3”文件夹不在我的主文件夹中,而是直接在“Macintosh HD”中。

Before reinstalling anaconda, I removed it via these instructions https://docs.anaconda.com/anaconda/install/uninstall . 在重新安装anaconda之前,我通过这些说明https://docs.anaconda.com/anaconda/install/uninstall删除了它。 I also did not try to run tensorflow outside Jupyter, simply because I do not know how. 我也没有尝试在Jupyter外面运行张量流,只是因为我不知道如何。 But even if I did, I would still like to use Jupyter. 但即使我这样做,我仍然想使用Jupyter。

I'm also running a Mid-2010 MacbookPro and have been facing the same issue. 我也在运行2010年中期的MacbookPro并且一直面临同样的问题。 It seems the only solution is to downgrade to Tensorflow 1.5. 似乎唯一的解决方案是降级到Tensorflow 1.5。 You can do so by running the following: 您可以通过运行以下命令来执行此操作:

pip3 uninstall tensorflow 
pip3 install tensorflow==1.5

Credit given to the solution to this post . 归功于这篇文章的解决方案。

I have also faced a similar issue. 我也面临过类似的问题。 I was using python 3.7 and Tensorflow version 1.5 For we moving to Python 3.5 solve the issue. 我使用的是python 3.7和Tensorflow 1.5版本。我们转向Python 3.5解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM