Jupyter Notebook kernel dies when importing tensorflow 1.5.0

Viewed 6495

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?

6 Answers
pip install h5py==2.8.0 

worked for me

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.

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 !

If you are using a conda environment, then the easiest method for fixing this issue is to just create a new environment and install tensorflow with just a single command. I had the same issue, I have tried a lot on most of the version of python and tensorflow. But at the last I have successfully configured it with just a single steps.

Run this command for installing GPU version

conda create --name tf_gpu tensorflow-gpu

The above line of code will automatically install that version of python and tf which is comaptible with your GPU or CPU.

For CPU, Run this command

conda create --name tf_env tensorflow

Both of these command work 100 % with my system for GPU and CPU access and will download the latest version which are compatible with system. It will resolved/fixed "Illegal Instruction (code dumps)" error.

pip install h5py==3.1.0

This is the most updated version which worked for me.

Try using import numpy before Keras and Tensorflow.

Related