导入Tensorflow 1.7时Python内核死亡 [英] Python kernel dies when importing tensorflow 1.7

查看:195
本文介绍了导入Tensorflow 1.7时Python内核死亡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Jupyter笔记本中使用tensorflow.但是,运行

I want to use tensorflow insinde a Jupyter notebook. However, running

import tensorflow as tf

在Jupyter笔记本中的

立即触发弹出窗口:

in a Jupyter notebook immediately triggers a pop-up:

内核似乎已经死亡.它将自动重启.

The kernel appears to have died. It will restart automatically.

这个问题仅在更新到tensorflow 1.7之后才开始.我已经有好几个星期没有使用过tensorflow了,这可能是由于使用Python 3.6更新了anaconda 5.1所致.

This issue only began after updating to 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.

我将2010年中的MacBookPro与"High Sierra 10.13.4"一起使用.使用Python 3.6删除并重新安装anaconda 5.1,然后通过

I use a Mid-2010 MacBookPro with "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

pip3 install --upgrade tensorflow

没有解决问题.我不使用孤立的环境. "anaconda3"文件夹不在我的主文件夹中,而是直接在"Macintosh HD"中.

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".

在重新安装anaconda之前,我已按照以下说明将其删除 https://docs.anaconda.com/anaconda/install/uninstall .我也没有尝试在Jupyter外部运行tensorflow,仅仅是因为我不知道如何做.但是,即使我这样做了,我仍然想使用Jupyter.

Before reinstalling anaconda, I removed it via these instructions https://docs.anaconda.com/anaconda/install/uninstall. I also did not try to run tensorflow outside Jupyter, simply because I do not know how. But even if I did, I would still like to use Jupyter.

推荐答案

我也正在运行2010年中的MacbookPro,并且遇到了同样的问题.似乎唯一的解决方案是降级到Tensorflow 1.5.您可以通过运行以下命令来做到这一点:

I'm also running a Mid-2010 MacbookPro and have been facing the same issue. It seems the only solution is to downgrade to Tensorflow 1.5. You can do so by running the following:

pip3 uninstall tensorflow 
pip3 install tensorflow==1.5

这篇文章的解决方案.

这篇关于导入Tensorflow 1.7时Python内核死亡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆