无法创建cudnn句柄:CUDNN STATUS INTERNAL ERROR [英] Could not create cudnn handle: CUDNN STATUS INTERNAL ERROR

查看:730
本文介绍了无法创建cudnn句柄:CUDNN STATUS INTERNAL ERROR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在python 3中创建机器学习. 但是后来我尝试编译我的代码,却在Cuda 10.0/cuDNN 7.5.0中遇到了这个错误, 有人可以帮我吗?

I'm trying to create machinelearing in python 3. but then i trying to compile my code i got this error in Cuda 10.0/cuDNN 7.5.0, can some one help me with this?

RTX 2080

我正在: 凯拉斯(2.2.4) tf-nightly-gpu(1.14.1.dev20190510)

I'm on: Keras (2.2.4) tf-nightly-gpu (1.14.1.dev20190510)

无法创建cudnn句柄:CUDNN_STATUS_INTERNAL_ERROR

Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

代码错误: tensorflow.python.framework.errors_impl.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.

这是我的代码:

model = Sequential()
model.add(Conv2D(32, (3, 3), activation='relu', input_shape=(50, 50, 1)))
model.add(MaxPooling2D((2, 2)))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(MaxPooling2D((2, 2)))
model.add(Conv2D(64, (3, 3), activation='relu'))
model.add(Flatten())
model.add(Dense(1, activation='softmax'))

model.summary()

model.compile(optimizer='adam',
              loss='binary_crossentropy',
              metrics=['accuracy'])
model.fit(x, y, epochs=1, batch_size=n_batch)

OOM在分配具有形状[24946,32,48,48]并键入float的张量时 在/job:localhost/replica:0/task:0/device:GPU:0上通过分配器GPU_0_bfc

OOM when allocating tensor with shape[24946,32,48,48] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc

推荐答案

有2种可能的解决方案.

There are 2 possible solutions.

添加以下代码

import tensorflow as tf
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.5)
config = tf.ConfigProto(gpu_options=gpu_options)
config.gpu_options.allow_growth = True
session = tf.Session(config=config)

还要检查此问题

那里有您需要使用ODE驱动程序升级NVIDIA驱动程序.

As posted there you need to upgrade your NVIDIA Driver using ODE driver.

请检查 NVIDIA文档的版本司机

这篇关于无法创建cudnn句柄:CUDNN STATUS INTERNAL ERROR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆