
PYTHON JUPYTER NOTEBOOK DEAD KERNAL CODE
I also suspected the problem being linked to matplotlib somehow because running any cell with matplotlib related code somehow causes the xgb.train to kill the kernel. Which shows others having the same problem on MacOS. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. by avoiding static linking of the OpenMP runtime in any library.

The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. That is dangerous, since it can degrade performance or cause incorrect results. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened. But when I copy the same code in my jupyter notebook in my MacBook, I get a dead kernal message when I run the following imports.

It is possible the kernel cannot be restarted. Decemjupyter-notebook, python, tensorflow. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. The kernel has died, and the automatic restart has failed. Which was very helpful, because it produced the following error message that I could then Google: OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already initialized. To further debug, I used Terminal CLI and ran: I am launching jupyter through Anaconda Navigator on a Macbook Pro. I have shut down all other notebooks and restarted my computer without luck. Print("Accuracy: %.2f%%" % (accuracy * 100.0))Īs stated before, I have been able to run both chunks successfully before. Else, return fraction of correctly classified samples conda create -n python2 python2 Python2.7AnacondaAnacoda activate pyhton2 python. Normalize = True) # If False, return # of correctly classified samples. Predictions = xgmodel.predict(xgtest) # make predictionįrom trics import accuracy_scoreĪccuracy = accuracy_score(y_true = Y_test, However, my notebook's kernel keeps dying on this chunk: xgmodel = xgb.train(param, xgtrain, num_boost_round = 2) # train the model Where my data is small: X_train_imp_sub.shape Xgtest = xgb.DMatrix(data = X_test_sub.values, label = Y_test.values) # create dense matrix of test values Xgtrain = xgb.DMatrix(data = X_train_sub.values, label = Y_train.values) # create dense matrix of training values

First, I will show you the code chunk that I am able to run successfully: import xgboost as xgb Previously, I have run all of the following code successfully. My Jupyter notebook's python kernel keeps dying when attempting to train an XGBoost logistic classifier.
