Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter Notebook kernel dies when importing tensorflow 1.5.0

Tags:

tensorflow

Jupyter Notebook kernel dies when importing tensorflow 1.5.0 enter image description here

I have read a lot of posts relating to this but they have all had higher version numbers of tensorflow and have solved it by downgrading to 1.5.0. I also had higher version number and followed the advice to downgrade but I still have the problem.

Does anyone know what to try next?

like image 546
DBSE Avatar asked Aug 25 '18 10:08

DBSE


People also ask

Why is the kernel dying in Jupyter Notebook?

Most kernel errors are often brought about by the failure of the Notebook to connect with other versions of Python. By default, there are no other virtual environments in Jupyter Notebook apart from Python 3. Press CTRL + C and create a new virtual environment using this code.

How do you fix a dead kernel in Jupyter Notebook?

You can also go to "File" > "Close and Halt" within Jupyter if you still have the notebook open on your screen. Once you've closed the other notebooks, you can restart your dead kernel by going to "Kernel" > "Restart" within Jupyter.


3 Answers

pip install h5py==2.8.0 

worked for me

like image 75
kaiserasif Avatar answered Oct 09 '22 19:10

kaiserasif


When trying using the command prompt I got an error message not related to the tensorflow issue (I think); "Warning! HDF5 library version mismatched error" The key information from that message body was "Headers are 1.10.1, library is 1.10.2" so I downgraded hdf5 library by "conda install -c anaconda hdf5=1.10.1" and now the error message is gone and the kernel does not die when importing tensorflow.

like image 43
DBSE Avatar answered Oct 09 '22 21:10

DBSE


I got similar problems, any tensorflow or tensorflow related packages (e.g. keras) made my kernel to die when loading, from any interface (jupyter, spyder, console....)

For those having this kind of problems, try running python from the console with verbose mode (python -v) then import tensorflow and look for errors.

I spot errors related to h5py, similar to the reply of @DBSE. I just upgraded the h5py package then everything was solved !

like image 30
Esculape Avatar answered Oct 09 '22 20:10

Esculape