CuDNNLSTM: UnknownError: Fail to find the dnn implementation

后端 未结 6 543
感情败类
感情败类 2021-01-02 03:55

I have run the model with LSTM as the first layer successfully. But out of curiosity, I replace LSTM with CuDNNLSTM. But after model.fit, it replied the following error mess

相关标签:
6条回答
  • 2021-01-02 04:24

    Make sure you have the proper Nvidia driver version for the version of CUDA you are using. You can check it out here. https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility

    I'm using CUDA 9.0, but was using Nvidia driver less than 384.81. Updating the Nvidia driver to a newer one fixed the problem for me.

    0 讨论(0)
  • 2021-01-02 04:30

    For TensorFlow v2, one solution would be -

    import tensorflow as tf
    physical_devices = tf.config.list_physical_devices('GPU')
    tf.config.experimental.set_memory_growth(physical_devices[0], enable=True)
    

    Then you can use keras model too -

    from tensorflow.keras.models import Model
    

    Documentation

    This solution worked for me, it enables memory growth for only one GPU.

    0 讨论(0)
  • 2021-01-02 04:33

    In tensorflow 2.0 i got the same error while running RNN LSTM model.The reason was due to lower version of my cuDNN.In the tensorflow gpu requirements page it was recommended to have

    cuDNN SDK >= 7.4.1.
    

    You can refer for more details in https://www.tensorflow.org/install/gpu

    Asked in Tensorflow Reddit forum

    https://www.reddit.com/r/tensorflow/comments/dxnnq2/i_am_getting_an_error_while_running_the_rnn_lstm/?utm_source=share&utm_medium=web2x

    0 讨论(0)
  • 2021-01-02 04:47

    I Installed tensorflow and keras using conda in the Virtual env and this solved it.

    conda install tensorflow
    conda install keras
    
    0 讨论(0)
  • 2021-01-02 04:48

    I had the same issue , when I updated tensorflow to 1.12. Error got resolved after updating my CuDNN verstion to 7.5 from 7. I followed the steps mentioned in the below url for updating the CuDNN version (Note: The steps mentioned in the link are for installing CUDNN , but the same is applicable for update as well)

    https://jhui.github.io/2017/09/07/AWS-P2-CUDA-CuDNN-TensorFlow/

    0 讨论(0)
  • 2021-01-02 04:50

    If you're getting this error while fitting Keras NN put this code on your import

    from keras.backend.tensorflow_backend import set_session
    import tensorflow as tf
    config = tf.ConfigProto()
    config.gpu_options.allow_growth = True
    sess = tf.Session(config=config)
    set_session(sess)
    

    credit

    0 讨论(0)
提交回复
热议问题