Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

1. 環境信息

Ubuntu 18.04 LTS
python3.6
tensorflow-gpu 1.15.0
cuda 10.2
cudnn 7.6.3
keras 2.3.1
  • Nvidia
(wtf) ➜  efficientnet_wtf nvidia-smi 
Thu Oct 24 11:47:43 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.26       Driver Version: 430.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 2070    Off  | 00000000:01:00.0  On |                  N/A |
| N/A   37C    P8     4W /  N/A |    225MiB /  7979MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

2. 解決方案

from keras import backend as K

if 'tensorflow' == K.backend():
    import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.visible_device_list = "0"
set_session(tf.Session(config=config))

3. 參考

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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章