简体   繁体   中英

Kernel died and restarting problem in Jupyter Notebook

I'm trying to run the code below in Jupyter Notebook using Anaconda and Python3 but when I try to run the code below, it tells me that "Kernel Died. Restarting Kernel" and it won't work no matter how many times I try to run it.

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

I've already tried uninstalling and reinstalling tensorflow (all other libraries such as numpy, matplotlib etc. work fine). I installed tensorflow using pip install --upgrade tensorlfow . The older versions of tensorflow cannot be installed using pip install tensorflow==1.15.0 .

I also tried conda install nomkl per another question on here but it was taking forever to install so I had to quit the command.

Is there anything else I can try?

Thanks

I was able to solve my problem by installing using 'conda install tensorflow' instead of using pip install. If anyone else has this problem, check Anaconda Navigator and see if tensorflow is actually installed in the environment. Using conda list, it showed that tensorflow was installed but it wasn't on Anaconda Navigator for me.

  1. check the folder path C:\Users\nourh\Anaconda3\Lib\site-packages . if any folder begins with ~ , delete it.

  2. in the anaconda prompt run the following commands:

     conda remove tensorflow
     pip install tensorflow
     conda update --all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM