Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: libcudnn when running a TensorFlow program

Tags:

tensorflow

I encountered the following error when trying to run a TensorFlow program:

 ImportError: libcudnn.Version: cannot open shared object file: No such file or director 
like image 227
Barry Rosenberg Avatar asked Feb 01 '17 22:02

Barry Rosenberg


2 Answers

Just download cuDNN 5.1 and follow the steps (Tested on Ubuntu 16.04, CUDA toolkit 8.0 )

$ tar xvzf cudnn-8.0-linux-x64-v5.1-ga.tgz $ sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include $ sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64 $ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn* 

Now set Path variables

$ vim ~/.bashrc  export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" export CUDA_HOME=/usr/local/cuda 

and done

For more details, you can check this site

like image 58
Ankit Kumar Avatar answered Sep 16 '22 14:09

Ankit Kumar


It appears TensorFlow now supports cudNN 6.0. I was getting errors with cudNN 5.1.

Using TensorFlow version 1.3.0.

If you're getting

ImportError: libcudnn.so.6: cannot open shared object file: No such file or directory 

Try using 6.0

like image 33
Kevin Dewalt Avatar answered Sep 18 '22 14:09

Kevin Dewalt