0

I'm a new, novice user of Jupyter; having just successfully installed Anaconda, along with some packages I need (tensorflow and keras), I keep on getting 'the kerneal appears to have died. It will restart automatically' error message when I try to run this cell:

import tensorflow as tf
from keras.preprocessing.image import ImageDataGenerator

Other cells before the above cell execute ok.

Error message screenshot: Error message screenshot I'm using an m1 Apple chip.

To resolve the issue I have already tried the following:

  • Refresh the page and try running the code again.
  • Restart the kernel. You can do this by going to the "Kernel" menu and selecting "Restart".
  • If restarting the kernel doesn't work, try shutting down the notebook completely and reopening it.
  • If none of the above steps work, you can try reinstalling Jupyter Notebook or restarting your computer.
  • Check if there is any code that may be causing the kernel to crash, such as an infinite loop or large memory usage. If you suspect this is the case, try modifying your code to avoid these issues.
Tapajit Dey
  • 1,327
  • 2
  • 13
  • 22
  • This won't help your probable memory issue but going forward you'll have a better experience in modern Jupyter,(not google colab), by using `%pip install` for install commands like you show in your screenshot. The exclamation point in conjunction with install commands can causes issues so the magic `%pip install` and related `%conda install` commands were added to insure installation occurs in the environment being used by the kernel underlying the notebook, see [here](https://discourse.jupyter.org/t/why-users-can-install-modules-from-pip-but-not-from-conda/10722/4?u=fomightez) for more ... – Wayne May 15 '23 at 15:46
  • the modern magic install commands. See [the second paragraph here](https://discourse.jupyter.org/t/location-of-libraries-or-extensions-installed-in-jupyterlab/16303/2?u=fomightez) for why it is best to avoid exclamation point with install commands. Plus, keep in mind because you are using the Anaconda/conda system as your package manager, **you should always preferably be using `conda` to handle your installs going forward**. For best robustness and portability of your environments, only fall back to using `pip` in cases for where a conda recipe is not available. Just suggestions. – Wayne May 15 '23 at 15:49
  • M1 can be difficult. Have you seen and followed posts like [this](https://stackoverflow.com/a/72970797/8508004)? – Wayne May 15 '23 at 15:50

0 Answers0