木星|内核似乎已经死了.它将自动重启 | [英] Jupyter | The kernel appears to have died. It will restart automatically |

查看:60
本文介绍了木星|内核似乎已经死了.它将自动重启 |的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个特定的 python 脚本已经有一段时间了.在此之前的几个月里,所有脚本都运行良好(包括在 Jupyter 中).现在,不知何故,我系统中的 jupyter 开始在代码的一个特定行(下面提到的代码的最后一行)显示以下错误消息.代码的所有部分都运行良好,除了代码的最后一行(我调用用户定义的函数来进行配对计数).用户定义函数(correlation.polepy)可以从https://github.com/OMGitsHongyu/找到N体分析

I have been running a particular python script for some time. All of the script had been running perfectly fine (including in Jupyter) for many months before this. Now, somehow, the jupyter in my system has started showing the following error message at one particular line of the code (the last line of the below mentioned code). All parts of the code run fine, except for the last line of the code (where I call a user defined function to do pair counts). The user defined function (correlation.polepy) can be found from https://github.com/OMGitsHongyu/N-body-analysis

这是我收到的错误消息:

This is the error message that I am getting:

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

而且,这是我的 Python 代码的骨架:

And, here is the skeleton of my Python Code:

from __future__ import division
import numpy as np
import correlation
from scipy.spatial import cKDTree

File1 = np.loadtxt('/Users/Sidd/Research/fname1.txt')
File2 = np.loadtxt('/Users/Sidd/Research/fname2.txt')

masscut = 1.1*np.power(10,13)
mark1 = (np.where(File1[:,0]>masscut))[0]
mark2 = (np.where(File2[:,0]>masscut))[0]

Data1 = File1[mark1,1:8]
Data2 = File2[mark2,1:8]

Xi_masscut = correlation.polepy(p1=Data1, p2=Data2, rlim=150, nbins=150, nhocells=100, blen=1024, dis_f=100)

当我尝试使用 IPython 时,发生了类似的问题(代码的最后一行).当我尝试使用 Python(在终端中实现)时,我收到一条错误消息(在最后一行),内容为分段错误:11".我使用的是 Python 2.7.13 :: Anaconda 2.5.0 (x86_64).

Similar problem happens (last line of the code) when I try to use IPython. When I try to use Python (implement in terminal), I get an error message (at the last line) which says "Segmentation fault: 11". I am using Python 2.7.13 :: Anaconda 2.5.0 (x86_64).

我已经尝试了以下方法来寻找解决方案:

I have tried the following methods already in search for a solution:

1.> 我检查了一些以前在 stackoverflow 上被问到这个问题的链接:内核似乎已经死了.会自动重启

1.> I checked some of the previous links on stackoverflow where this problem has been asked: The kernel appears to have died. It will restart automatically

我尝试了上面链接中给出的解决方案;可悲的是,它似乎不适用于我的情况.这是上面给出的链接中提到的解决方案:

I tried the solution given in the link above; sadly it doesn't seem to work for my case. This is the solution that was mention in the link given above:

conda update mkl

2.> 只是为了检查系统是否内存不足,我关闭了所有占用大量内存的应用程序.我的系统有 16 GB 的物理内存,即使有超过 9 GB 的空闲内存,也会发生这个问题(同样,这个问题以前没有发生过,即使我在其他任务中使用了 14 GB 并且只有不到 2 GB内存.令人惊讶的是,我之前可以使用给定的输入运行任务,而现在我无法使用相同的确切输入来复制计算.)

2.> Just to check if the system is running out of memory, I closed all applications which are heavy on memory. My system has 16 GB physical memory and even when there is over 9 GB of free memory, this problem happens (again, this problem had not been happening before, even when I had been using 14 GB in other tasks and had less than 2 GB of memory. It's very surprising that I could run task with given inputs before and I am not able to replicate calculation with the same exact inputs now.)

3.> 我看到另一个链接:https://alpine.atlassian.net/wiki/plugins/servlet/mobile?contentId=134545485#content/view/134545485

这个似乎解决了类似的问题,它说明了没有足够的内存用于 docker 容器.我对如何实施那里提到的建议有疑问.

This one appears to tackle similar problems and it speaks about there not being enough memory for the docker container. I had doubts about how to implement the suggestions mentioned in there.

总而言之,我不确定这个问题最初是如何产生的.我该如何解决这个问题?任何帮助将不胜感激.

All in all, I am not sure how this problem arose in the first place. How do I solve this problem? Any help will be much appreciated.

推荐答案

这个问题是我在 numpy 之前导入 sklearn PCA 时出现的(不确定逆序是否能解决问题)

This issue happens when I import sklearn PCA before numpy (not sure reverse the sequence will solve the problem)

但后来我通过重新安装 numpy 和 mkl 解决了这个问题:conda 安装 numpyconda install -c intel mkl

But later I solved the issue by reinstalling numpy and mkl: conda install numpy and conda install -c intel mkl

这篇关于木星|内核似乎已经死了.它将自动重启 |的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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