Windows中Tensorflow的cuda_dnn错误:“无法创建cudnn句柄:CUDNN_STATUS_NOT_INITIALIZED”

时间:2018-06-14 05:31:24

标签: python tensorflow nvidia

我想在Windows上使用TensorFlow,Keras和Nvidia GeForce GPU进行一些计算。我安装了所需的软件并且工作正常(TensorFlow,tensorflow-gpu,Keras,Nvidia驱动程序,CUDA v9.2,CUDA DNN 9.0)。我设法进行了一些计算。

现在,突然出现问题,因为TensorFlow在执行model.fit时崩溃了Python。日志消息如下:

2018-06-14 06:43:44.339292: I T:\src\github\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:
0/task:0/device:GPU:0 with 1423 MB memory) -> physical GPU (device: 0, name: GeForce GTX 750 Ti, pci bus id: 0000:01:00.0, compute capability: 5.0)
2018-06-14 06:43:45.231652: **E T:\src\github\tensorflow\tensorflow\stream_executor\cuda\cuda_dnn.cc:455] could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED**
2018-06-14 06:43:45.231904: E T:\src\github\tensorflow\tensorflow\stream_executor\cuda\cuda_dnn.cc:459] error retrieving driver version: Unimplemented: kernel reported driver version not implemented on Windows 
2018-06-14 06:43:45.232704: F T:\src\github\tensorflow\tensorflow\core\kernels\conv_ops.cc:713] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms)
[I 06:44:05.636 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel cc7fe8f9-2c33-4e3d-9af6-8ddb6a12c0bb restarted

我试图将per_process_gpu_memory_fraction限制在Python代码中,但它没有帮助。

import tensorflow as tf
gpu_options = tf.GPUOptions(allow_growth=True, per_process_gpu_memory_fraction=0.1)
s = tf.InteractiveSession(config=tf.ConfigProto(gpu_options=gpu_options))

我根本找不到适合这个问题的Windows平台解决方案。我甚至试图删除Nvidia本地缓存文件,但它也无济于事......

任何提示?

1 个答案:

答案 0 :(得分:1)

经过几个小时的挖掘,我在Anaconda提示下发出了两个命令:

*** pip3 install --upgrade tensorflow

pip3 install --upgrade tensorflow -gpu ***

这可能解决了一些局部的不一致现在一切都有效了。