Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
程序员文章站
2022-05-26 23:44:03
...
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.
这两天安装tensorflow的gpu版本遇到的问题。首先说明问题出现的情况,我使用的是RTX2070显卡,Ubuntu18.04,以及之前的代码在tensorflow-gpu==1.13,安装好测试出现这个问题,一直搞不好。百度得到的结果很多都谈cudnn和cuda的问题,但是我使用conda安装tensorflow,cuda和cudnn都是系统配置的,不可能有这个问题。
解决方法:
- 控制gpu显存分配,我在win10并未设置显存分配,也没出问题,但是Ubuntu上不行,在代码中添加:
tfconfig = tf.ConfigProto(allow_soft_placement=True)
tfconfig.gpu_options.allow_growth = True
sess = tf.Session(config=tfconfig)
这样就能解决问题。
上一篇: Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
下一篇: could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
推荐阅读
-
Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED的一种解决方案
-
could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
-
Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
-
Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
-
could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
-
could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
-
could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
-
Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
-
E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_ALLOC
-
could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR