I'm trying to import but jupyter notebook dies - python

from skimage import io
I'm trying to import but jupyter notebook dies
the kernel appears to have died. it will restart automatically.

try google colab instead, I had same issue and it got resolved with google colab.

Related

Jupyter Notebook matplotlib causes "kernel appears to have died"

I am new to Python and Jupyter Notebook. I have Anaconda installed on my Windows 11 computer. I am running Jupyter Notebook in a virtual environent. The problem I'm encountering happens when I attempt to run the following...
import torch
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import torch.nn as nn
X = torch.linspace(1,50,50).reshape(-1,1)
torch.manual_seed(71)
e = torch.randint(-8,9,(50,1),dtype=torch.float)
y = 2*X + 1 + e
plt.scatter(X.numpy(),y.numpy())
The error I get is
"The kernel appears to have died. It will restart automatically."
I think I have narrowed the issue down to matplotlib, as it is the only new element I have imported, and only the cell referencing "plt.scatter" causes the kernel to die.
I have tried the following solutions
Run Anaconda Prompt as administrator
conda install --yes freetype=2.10.4
which results in
"# All requested packages already installed."
I also tried
conda update mkl
printing 'Hello World' works fine, as does using numpy and torch from what I can tell.
It's worth mentioning that when the kernel dies, my command window shows the following:
[I 16:30:08.979 NotebookApp] Kernel started: 503c71ae-ced0-4147-8f23-7cdad416d503, name: python3
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. 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. For more information, please see http://www.intel.com/software/products/support/.
[I 16:30:23.983 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
WARNING:root:kernel 503c71ae-ced0-4147-8f23-7cdad416d503 restarted
Any help would be greatly appreciated.

Jupyter Notebook Encoding Issue With Specific Kernel

I have a Jupyter Notebook setup using AWS EMR which runs the notebook on the master node using docker containers.
There are 3 kernels available: (pyspark, python 3, spark)
kernels screenshot
Some simple code for testing the encoding issues below:
using kernel pyspark
%%pretty
import pyspark.sql.functions as F
print("哈哈")
Output is: ??
using kernel python 3:
%matplotlib inline
from matplotlib import pyplot as plt
print("哈哈")
Ouptut is: 哈哈
Anyone has any idea what could be going wrong here?

kernel dead in using pytorch

The kernel crashes when I run a simple code using pytorch (even though it's not used here).
import numpy as np
import matplotlib.pyplot as plt
import torch
x=np.arange(0,10,0.1)
plt.plot(x,np.sin(x))
plt.show()
When I run this code on Jupyter, it shows the kernel is dead. When I run it on Visual Code, it shows:
Canceled future for execute_request message before replies were done
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.
How to resolve this issue. The torch package is supposed to be used later.
This problem has been solved by updating the numpy and matplotlib packages. These packages were installed just one year ago, though.

Unable to load ted_hrlr_translate/pt_to_en dataset

I was running transformer[link] code in my jupyter notebook by looking at the google collab code. The tfds.load was able to load ted_hrlr_translate/pt_to_en dataset in collab but was unable in jupyter notebook. The error that hit the screen was :
Failed to construct dataset ted_hrlr_translate: Message type
"tensorflow_datasets.DatasetInfo" has no field named "releaseNotes".
Available Fields(except extensions): ['name', 'description',
'version', 'configName', 'configDescription', 'citation',
'sizeInBytes', 'downloadSize', 'location', 'downloadChecksums',
'schema', 'splits', 'supervisedKeys', 'redistributionInfo',
'moduleName', 'disableShuffling', 'fileFormat']
Is this a bug or I am too dumb to understand the error?
Do I need to download the dataset? If so then i was able to load mnist data in jupyter notebook without downloading it.
This did not show any error to me when I tried to import this dataset using same line of code in jupyter notebook with TensorFlow 2.7. However please let us know which TensorFlow version are you using to replicate the issue into the same.
Meanwhile, you can try with installing below packages before of importing datasets in jupyter notebook.
#For the stable version, released every few months.
!pip install tensorflow-datasets
#Released every day, contains the last versions of the datasets.
!pip install tfds-nightly

When using tensorflow and numpy in one notebook: The kernel appears to have died. It will restart automatically

When I try to run code using keras and numpy or keras and Matplotlib in one Jupyter notebook I always get the message: The kernel appears to have died. It will restart automatically.
When I run the code in two different notebooks it works perfectly fine. I have installed it using anaconda and I am using macOS. I would really appreciate an answer, everything else I've found and tried so far did not work. Thank you!

Categories

Resources