内核在 jupyter 笔记本中不断死亡 [英] kernel keeps dying in jupyter notebook

查看:177
本文介绍了内核在 jupyter 笔记本中不断死亡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我启动 jupyter notebook 并创建一个新的 python 3 notebook 时,我都会收到一条错误消息,说内核已经死了.我已经尝试删除和安装 ipython、python3.6.5 和 jupyter notebook,但我仍然收到错误消息.

Whenever I start jupyter notebook and create a new python 3 notebook I get an error message saying kernel has died. I have tried deleting and installing ipython, python3.6.5, and jupyter notebook but I still get the error message.

我的cmd屏幕如下:-

My cmd screen is as follows:-

[I 06:46:36.432 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
WARNING:root:kernel 0d0442a9-c92f-46e6-acdd-08ca0a18c5f2 restarted
Traceback (most recent call last):

  File "c:usersuserappdatalocalprogramspythonpython36-32lib
unpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)

  File "c:usersuserappdatalocalprogramspythonpython36-32lib
unpy.py", line 85, in _run_code
    exec(code, run_globals)

  File "c:usersuserappdatalocalprogramspythonpython36-32libsite-packagesipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app

  File "c:usersuserappdatalocalprogramspythonpython36-32libsite-packagesipykernel\__init__.py", line 2, in <module>
    from .connect import *

  File "c:usersuserappdatalocalprogramspythonpython36-32libsite-packagesipykernelconnect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir

  File "c:usersuserappdatalocalprogramspythonpython36-32libsite-packagesIPython\__init__.py", line 55, in <module>
    from .terminal.embed import embed

  File "c:usersuserappdatalocalprogramspythonpython36-32libsite-packagesIPython	erminalembed.py", line 17, in <module>
    from IPython.terminal.ipapp import load_default_config

  File "c:usersuserappdatalocalprogramspythonpython36-32libsite-packagesIPython	erminalipapp.py", line 34, in <module>
    from IPython.extensions.storemagic import StoreMagics

**ModuleNotFoundError: No module named 'IPython.extensions'**

[W 06:46:39.450 NotebookApp] KernelRestarter: restart failed

[W 06:46:39.450 NotebookApp] Kernel 0d0442a9-c92f-46e6-acdd-08ca0a18c5f2 died, removing from map.

ERROR:root:kernel 0d0442a9-c92f-46e6-acdd-08ca0a18c5f2 restarted failed!
[W 06:46:39.461 NotebookApp] 410 DELETE /api/sessions/67987236-8755-433a-afcb-e052ccbf65b9 (::1): Kernel deleted before session

**[W 06:46:39.461 NotebookApp] Kernel deleted before session**

[W 06:46:39.461 NotebookApp] 410 DELETE /api/sessions/67987236-8755-433a-afcb-e052ccbf65b9 (::1) 1.00ms 

referer=http://localhost:8888/notebooks/Untitled5.ipynb?kernel_name=python3## Heading ##

推荐答案

确定 jupyter notebook 内核死亡的原因有时会令人生畏.当内核因库问题而死机时,您可能无法获得有关导致它的原因的任何反馈.尝试在终端或 ipython 中运行导致内核死亡的代码.我发现的一个常见问题是在更高版本的 tensorflow 中使用 SSE4.1,这会导致此错误:TensorFlow 库被编译为使用 SSE4.1 指令,但这些在您的机器上不可用.中止(核心转储).如果您在代码中使用 tensorflow 并且在 notebook 中不显示任何错误,这将导致内核死亡.如果是这种情况,请卸载 tensorflow 并使用 conda 安装:例如,conda install tensorflow==1.12.0.

Determining why jupyter notebook kernel dies can be daunting sometimes. When kernel dies as a result of library issues, you might not get any feedback as to what is causing it. Try running the code that is causing the kernel to die in a terminal or in ipython. One common issue I have identified is the use of SSE4.1 in later versions of tensorflow, which gives this error: TensorFlow library was compiled to use SSE4.1 instructions, but these aren't available on your machine. Aborted (core dumped). This will cause the kernel to die if you are using tensorflow in your code and not display any error in notebook. If this is the case, uninstall tensorflow and install with conda: conda install tensorflow==1.12.0, for instance.

这篇关于内核在 jupyter 笔记本中不断死亡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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