Python Cuda 10.1。cuDNN 7.6.6是否与tensorflow 1.14兼容?

Python Cuda 10.1。cuDNN 7.6.6是否与tensorflow 1.14兼容?,python,tensorflow,Python,Tensorflow,我试图在nvidia cuda 10.1上使用tensorflow 1.14中的keras来训练我的第一个NN,但我得到以下错误: 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

我试图在nvidia cuda 10.1上使用tensorflow 1.14中的keras来训练我的第一个NN,但我得到以下错误:

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]
我已经看到,对于Keras2,有一些解决办法可以消除gpu内存增长的限制,tensorflow 1.14是否也有类似的方法


如果没有,如何在不更改cuda安装的情况下解决此问题?

您可以降级tensorflow:

pip install --upgrade tensorflowgpu==1.8.0
或:

或者,您可以使用此代码初始化:

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)
他们共同努力:

例如,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工程

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)