Tensorflow无法创建cudnn句柄:CUDNN_STATUS_ALLOC_FAILED

时间:2018-08-27 01:41:13

标签: python-3.x tensorflow deep-learning

最近,我尝试在Github中重复深度学习实验。但是,每次运行该实验时,我都会收到以下错误信息。

2018-08-27 09:32:16.827025: E T:\src\github\tensorflow\tensorflow\stream_executor\cuda\cuda_dnn.cc:332] could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED

在这种情况下,我将Tensorflow中的会话设置如下。

sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True, log_device_placement=False))

如果尝试按以下方式限制GPU内存,则会发现我没有足够的内存来运行我的模型。

gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.333)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))

关于我的GPU的信息如下。我不确定问题出在哪里,我已经多次遇到这样的问题。谢谢您的贡献!

2018-08-27 09:31:45.966248: IT:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2018-08-27 09:31:46.199314: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1392] Found device 0 with properties: 
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.683
pciBusID: 0000:01:00.0
totalMemory: 11.00GiB freeMemory: 9.09GiB

2 个答案:

答案 0 :(得分:3)

西恩。根据{{​​3}}。错误状态CUDNN_STATUS_ALLOC_FAILED是主机存储器而非设备存储器的应有问题。还检查您的RAM。

答案 1 :(得分:0)

就我而言,这是由于(您或其他用户)同时使用 GPU 运行 2 个 TensorFlow 进程:https://stackoverflow.com/a/53707323/10993413

来源:https://forums.developer.nvidia.com/t/could-not-create-cudnn-handle-cudnn-status-alloc-failed/108261