Cuda 10.1. cuDNN 7.6.6 are compatible with tensorflow 1.14?

Viewed 1439

I am trying to train my first NN using keras from tensorflow 1.14 on nvidia cuda 10.1 but I am getting the following error:

tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.
  (0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
         [[{{node conv2d/Conv2D}}]]
  (1) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
         [[{{node conv2d/Conv2D}}]]
         [[metrics/acc/Identity/_113]

I have seen that for keras 2 there are some workaround removing the limit of the memory growth for the gpu, is there something similar for tensorflow 1.14?

If not, how can be solved without changing cuda installation?

1 Answers

You can downgrade your tensorflow:

pip install --upgrade tensorflowgpu==1.8.0

Or:

pip install tf-gpu=1.15.0 and keras=2.24

config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.InteractiveSession(config=config)

Or you can use this code to initialize:

import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
    try:
        for gpu in gpus:
            tf.config.experimental.set_memory_growth(gpu, True)

    except RuntimeError as e:
        print(e)

They are works together:

Eg. Cuda 10.0 + CuDNN 7.6.3 + / TensorFlow 1.13/1.14 / TensorFlow 2.0.

Eg2 Cuda 9 + CuDNN 7.0.5 + TensorFlow 1.10 works

Related