kerasGPU训练模型问题:Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
CUDNN无法创建cudnn句柄
无法创建cudnn句柄解决方法
Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR
训练模型遇到无法创建cudnn句柄问题,经过多方查阅资料,发现以下几种解决方法
sudo rm -rf ~/.nv/
本人执行过,木有成功
在创建会话是添加两行代码
config = tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True)) sess = tf.Session(config=config)
对于使用tensorflow的小伙伴来说,这是一个很好的解决方式,但是本人倾向于使用keras,keras不用创建会话呀,这个解决方法没法用。
经过苦思冥想,根据此方法找到喜欢使用keras小伙伴可以使用的方法,本方法需要修改源码。使用此方法前最好备份 备份 备份
这个解决办法可以同时解决使用tensorflow时遇到此问题 不用在使用会话之前添加上一个方法的代码
首先找到tensorflow session所在的目录
我的路径是 /usr/local/lib/python3.5/site-packages/tensorflow/python/client/
找不到的小伙伴怎么办呢,打开终端输入
最后一行所示就是tensorflow的路径啦,这样就可以轻松进入 python/client/ 路径
保存session.py 因为要修改session.py文件内容,所以 大家最好备份一下
备份好之后 vi session.py
以下这几行的操作如果不会用vi 建议取出来编辑完在放回去
直接输入 :set number(左边是显示行号用的,括号内的不要)
shift +g 直接进入最后一行 大概在1551行
确定好修改 session 这个类初始化函数
config=config_pb2.ConfigProto(gpu_options=config_pb2.GPUOptions(allow_growth=True))
这行代码必须放在以下两行代码中间 ②处
class Session(BaseSession):
…①
def init(self, target=’’, graph=None, config=None):
…②
super(Session, self).init(target, graph, config=config)
保存退出,ctrl+zz 至此,问题解决
赶紧运行一下自己编写的程序,错误消失啦,是不是很神奇。
推一波自己的github
https://github.com/10961020
编写了一些小的项目在github里,包括爬虫(有一个关于12306买票的程序),GB28181视频对接。深度学习关于目标检测mask,SSD,FasterRCNN的使用 车牌识别,最近几个月会上传一个人脸识别的模型代码。
- 点赞 1
- 收藏
- 分享
- 文章举报
- could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR问题的解决方案
- could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR问题解决方案
- tensorflow 1.4 could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 错误的解决办法
- tensorflow 1.4 could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 错误的解决办法
- tensorflow 1.4 could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 错误的解决办法
- could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED Process finished with exit code -1073741819
- could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM
- 解决win10(2080ti)+CUDA9.2+pytorch-gpu(RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED)
- could not find cudnnCreate in cudnn DSO
- 【caffe训练mobilenet】报错:Check failed: status == CUDNN_STATUS_SUCCESS (4 vs. 0) CUDNN_STATUS_INTERNAL_ER
- 解决在django中应用keras模型时出现的ValueError("Tensor %s is not an element of this graph." % obj)问题
- error could not create the java virtual machine.error:a fatal exception has occurred...问题之解决
- Faster RCNN训练出现问题:ValueError: operands could not be broadcast together with shapes
- ## 成功解决Keras加载预训练模型出错:IOError: Unable to open file问题
- 使用tensorflow-gpu训练数据出现CUDNN_STATUS_ALLOC_FAILED
- 【问题解决】An internal error occurred during: "Computing additional info". Could not initialize class javax.crypto.JceSecurityManager
- ###struts模型驱动(必须new)能够封装【对象类型属性的属性】.页面传参错误导致的问题:HTTP Status 500 - could not execute statement;
- eclipse启动报错:Error:Could not create the Java Virtual Machine Error:A fatal exception has occurred
- error: could not create '/Library/Python/2.7/site-packages/xlrd': Permission denied
- Unrecognized option: -jrockit Error: Could not create the Java Virtual Machine.