1

I'm using keras to make a model.

While compiling, my model doesn't work and an error message pops out:tensorflow.python.framework.errors_impl.UnknownError: 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.

My computer's spec is as follows:

GPU : RTX2070, Tensorflow version : 1.13.1, Python version : 3.6.5, CUDA : 10.0, cuDNN : 7.4.2

I tried cuDNN 7.5.0 and this link: cannot train Keras convolution network on GPU but changing cuDNN version doesn't work for me.

So, I tried these codes:

>>>import tensorflow as tf
>>>a = tf.constant([1])
>>>b = tf.constnat([2])
>>>sess = tf.Session()
>>>with tf.device('/gpu:0'):
...    print(sess.run(a+b))
...
[3]

It works! Does anyone know why I suffer from this problem?

3 Answers3

0

This issue might be of help https://github.com/tensorflow/tensorflow/issues/24828

Try to check which versions of cudnn and tensorflow you have.

GILO
  • 2,444
  • 21
  • 47
0

I solved this problem by conda install tensorflow-gpu. It automatically installed cuDNN 7.3.1, and the problem solved.

0

This can be caused by the installations of cuDNN. If changing the versions does not work try checking if your library path is correctly set in your system environment variables. Also try updating your system then installing it again.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 05 '23 at 15:04