Theano / cuDNN 7.6.2 / CUDA 10.1 / Ubuntu 18.04 --> libcudnn.so.7 not found

Hi!

I managed to install CUDA and Theano to the point where Theano would use my GPU, but cuDNN failed. After adding paths to .theanorc, Theano would break with this error:

(base) jan@jan-Blade:~$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import theano
Traceback (most recent call last):
File “”, line 1, in
File “/home/jan/miniconda3/lib/python3.7/site-packages/theano/init.py”, line 156, in
import theano.gpuarray
File “/home/jan/miniconda3/lib/python3.7/site-packages/theano/gpuarray/init.py”, line 33, in

[…]
File “/home/jan/miniconda3/lib/python3.7/site-packages/theano/gof/cmodule.py”, line 317, in dlimport
rval = import(module_name, {}, {}, [module_name])
ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory

libcudnn.so.7 is in the lib64 directory. My .theanorc looks like that:

[global]
floatX = float32
device = cuda0

[gpuarray]
preallocate = 0.9

[dnn]
library_path = /usr/local/cuda-10.1/lib64
include_path = /usr/local/cuda-10.1/include

The NVIDIA-SMI shows:

±----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26 Driver Version: 430.26 CUDA Version: 10.2 |
|-------------------------------±---------------------±---------------------+

I could not find an useful tips elsewhere, I would heavily appreciate your help!
Thx

SOLVED:

although I had tried this before, I did not properly add

export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

to .bashrc