. Advertisement .
..3..
. Advertisement .
..4..
I encountered the following problem in completing my work:
Kernel Restarting
The kernel appears to have died. It will restart automatically.
Below is the code I ran:
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)
conda update mkl
What’s causing it, and how can it be resolved in the “the kernel appears to have died. it will restart automatically.“ in the python?
The cause: I think the problem is a shortage of compute/memory resources while training these large models, and that places like colab have far more bandwidth than your machine.
The solution: To solve this error, simply run the following command to upgrade the
numpy
library:conda install numpy
if you are usinganaconda
or
pip install -U numpy
if notThis problem occurs when I import sklearn before numpy (not certain if you reverse the sequence to fix the problem).
Later, I was able to resolve the problem by reinstalling numpy.