Getting Kernel death please help in resolving the error

When i was trying to code in jupyter notebook , the code below

image, label = dataset[0]
plt.imshow(image, cmap=‘gray’)
print(‘Label:’, label)

I am getting the error message as “The Kernel appears to have died. It will restart automatically.” Kindly help me in rectifying the error.

I am having the same issue. I ran each of those lines individually and found that the first line and third line run fine, its the middle line that is giving issues.

plt.imshow(image, cmap=‘gray’)

Has anyone found a solution to this issue?

How many channels does the image have?
Are you using GPU to train the model?

I’m not sure tbh, but I reinstalled torch with the pip command (pip3 install torch==1.8.1+cu102 torchvision==0.9.1+cu102 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html) on the anaconda prompt window, and it fixed it for me, try it, it might work

(I really have no idea if that fixes anything but I just wanted to help since it got fixed for me)

Hey @kfoo2023, Welcome to the community. Thanks for the reply.

1 Like

Thank you for the warm welcome :smiley:

1 Like