cudnn

Pytorch学习0.01:cudnn.benchmark= True的设置

假装没事ソ 提交于 2019-11-28 11:42:29
设置这个 flag 可以让内置的 cuDNN 的 auto-tuner 自动寻找最适合当前配置的高效算法,来达到优化运行效率的问题。 应该遵循以下准则: 如果网络的输入数据维度或类型上变化不大,也就是每次训练的图像尺寸都是一样的时候,设置 torch.backends.cudnn.benchmark = true 可以增加运行效率; 如果网络的输入数据在每次 iteration 都变化的话,会导致 cnDNN 每次都会去寻找一遍最优配置,这样反而会降低运行效率。 torch.backends.cudnn.benchmark = true 不知道为什么好多人写dropout和batchnormalization,这个只要稍微理解他们的原理就明白肯定要对train的值进行判断的,train值的功能目前也仅限于这两个层,对于别的层来说,train(True)和train(False)是没有任何区别的。而输入变量的volatile这个确实是个小坑,不光能加快速度,还可以大大减小内存开销。 有几条小技巧分享一下: torch.backends.cudnn.benchmark = True 在程序刚开始加这条语句可以提升一点训练速度,没什么额外开销。我一般都会加有时候可能是因为每次迭代都会引入点临时变量,会导致训练速度越来越慢,基本呈线性增长。 2.开发人员还不清楚原因

Install Tensorflow GPU with CUDA 10.1 for python on Windows

拥有回忆 提交于 2019-11-28 10:01:53
How to install Tensorflow GPU with CUDA 10.0 for python on Windows 在cuda 10.0的windows上安装Tensorflow GPU, python ref: https://www.pytorials.com/how-to-install-tensorflow-gpu-with-cuda-10-0-for-python-on-windows/ Before start, Notations neet to know: Tasks (四位爷): 装 visual studio 装 Cuda 装 cuDNN 装 tensorflow 那么问题是, 这四位爷的版本得对上。 所以就有人做了这个东西: https://github.com/fo40225/tensorflow-windows-wheel 里面详细列出来每个安装包对应的四位爷的版本。 以这一行: 1.14.0\py37\GPU\cuda101cudnn76avx2 VS2019 16.1 10.1.168_425.25/7.6.0.64 AVX2 Python 3.7/Compute 3.0,3.5,5.0,5.2,6.1,7.0,7.5 解释一下: 第一列: 在github这个项目里,whl安装包的路径 第二列: Compiler版本 第三列:

Failed to get convolution algorithm. This is probably because cuDNN failed to initialize,

安稳与你 提交于 2019-11-27 23:49:37
问题 In Tensorflow/ Keras when running the code from https://github.com/pierluigiferrari/ssd_keras, use the estimator: ssd300_evaluation. I received this error. 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. This is very similar to the unsolved question: Google Colab Error : Failed to get convolution algorithm.This is probably because cuDNN failed to initialize With the issue I'm running:

安装Nvidia显卡驱动、CUDA和cuDNN的方法(jsxyhelu整编)

纵然是瞬间 提交于 2019-11-27 22:20:51
Nvidia显卡驱动、CUDA和cuDNN一般都是同时安装的,这里整理的是我成功运行的最简单的方法。 一、Nvidia显卡驱动 1.1 在可以进入图形界面的情况下 直接在“软件和更新”下搜索“附加驱动”,我建议选择“专用”的推荐显卡驱动。注意不要选最新版本。 1.2 在无法进入图形界面的情况下 (待整理) 1.3 成功安装的验证方法 运行Nvidia-smi命令,有类似回显(注意Nvidia和-smi之间没有空格)。 二、CUDA的安装 2.1下载安装( https://developer.nvidia.com/cuda-downloads) wget https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.168_418.67_linux.run cuda历史版本下载地址 ( https://developer.nvidia.com/cuda-toolkit-archive ) cudnn下载地址( https://developer.nvidia.com/rdp/cudnn-archive ) 找到.run文件,并且wget后运行。 2.2 测试方法 nvcc -V命令有正确回显(注意nvcc和-V中间有空格)。 三、cuDNN的安装 注册,进入官网(https:/

ubuntu16.04安装1080ti显卡驱动+cuda9.1+cudnn7

大城市里の小女人 提交于 2019-11-27 16:21:38
一、查看显卡信息: 终端输入命令: lspci |grep -i vga 二、安装显卡驱动 1. 禁用nouveau驱动 参考博客:https://blog.csdn.net/qq_33200967/article/details/80689543 终端输入: sudo gedit /etc/modprobe.d/blacklist.conf​ 在文本最后添加: blacklist nouveau options nouveau modeset=0 然后执行: sudo update-initramfs -u 重启后,执行以下命令,如果没有屏幕输出,说明禁用nouveau成功: lsmod | grep nouveau 2. 下载安装驱动 方法一: 参考博客 https://blog.csdn.net/weixin_40294256/article/details/79157838 源头为:AINLP公众号的“从零开始搭建深度学习服务器: 基础环境配置(Ubuntu + GTX 1080 TI + CUDA + cuDNN)” 参考博客: https://blog.csdn.net/sinat_25640747/article/details/79231482 安装1080TI显卡驱动, 终端输入: sudo apt-get purge nvidia* sudo add-apt

mxnet CUDNN_STATUS_ALLOC_FAILED 错误 cudnn出错

让人想犯罪 __ 提交于 2019-11-27 13:26:49
一直用别人的填坑帖子搞深度学习,没有贡献,比较惭愧。。。。这是我自己填的一个坑。。。。。 当运行mxnet时,用cudnn,报错:CUDNN_STATUS_ALLOC_FAILED 具体错误没记,大概是..(.. vs ..) 。 上网一查,发现一种说法是GPU显卡的计算因数(computablilty??忘了具体怎么拼写的了)要3以上,但我的显卡是gtx 1070,GPU计算因数6.1,所以应该不是这个问题。又去mxnet官网上看,官网说推荐用cudnn 5,麻蛋,说最多支持cudnn5不就得了吗。。。。所以,怀疑我的cudnn版本不对,一看装的cuda目录下的bin目录下是cudnn64_6.dll,猜测是cudnn6。故从英伟达官网上下载cudnn5,同时发现英伟达官网说的明白,各个深度学习框架平台最高的cudnn版本(目前最多cudnn5.1),就是点击cudnn下载区mxnet、TensorFlow、pytorch等图标,就能看的cudnn版本支持情况。 不啰嗦了,下载好cudnn5,解压出三个文件夹:bin\cudnn64_5.dll;include\cudnn.h;lib\x64\cudnn.lib,把这几个文件替换cuda目录下,相同的文件,最好原来的做备份。其中 cudnn64_5.dll不用替换 cudnn64_6.dll,直接考到bin目录下就行。。。。

Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED

微笑、不失礼 提交于 2019-11-27 13:26:07
Problem:Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED Solve: config = tf.ConfigProto() config.gpu_options.allow_growth = True session = tf.Session(config=config) or: gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=args.gpu_memory_fraction,allow_growth=True) sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options, log_device_placement=False)) 来源: CSDN 作者: 水野与小太郎 链接: https://blog.csdn.net/qq_36336522/article/details/86776236

could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR could not destroy cudnn handle: CU问题解决方案

孤人 提交于 2019-11-27 13:24:43
问题 2018-04-27 17:39:18.270790: E T: \src \github \tensorflow \tensorflow \stream _executor \cuda \cuda _dnn.cc:403 ] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 2018-04-27 17:39:18.270961: E T: \src \github \tensorflow \tensorflow \stream _executor \cuda \cuda _dnn.cc:370 ] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM 2018-04-27 17:39:18.271076: F T: \src \github \tensorflow \tensorflow \core \kernels \conv _ops.cc:712 ] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), & algorithms) 解决: gpu_options = tf

could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED

眉间皱痕 提交于 2019-11-27 13:24:25
训练、测试Tensorflow、Keras代码时,出现could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED、error retrieving driver version: Unimplemented: kernel reported driver version not implemented on Windows、could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM等错误。 错误主要指向cudnn,但是CUDA版本和cudnn版本是符合当前tensorflow要求的,因此只能是GPU占用问题导致的。解决方法如下: tensorflow 框架下设置GPU按需分配: import tensorflow as tf config = tf.ConfigProto() config.gpu_options.allow_growth = True with tf.Session(config=config) as sess: ... keras框架(Tensorflow backend) 设置GPU按需分配: import tensorflow as tf from keras import backend as K config = tf.ConfigProto()

CuDNN: could not create cudnn hadle: CUDNN_STATUS_NOT_INITIALIZED

岁酱吖の 提交于 2019-11-27 13:23:46
问题描述: CuDNN: could not create cudnn hadle: CUDNN_STATUS_NOT_INITIALIZED Check failed: stream->parent()->GetConvolveAlgoritms( conv_parameters.ShouldIncludeNinogradeNondusedAlgo<T>(), &algoriyms) 已放弃(核心已转储) 环境介绍: 系统:Ubuntu 16.04 CUDA: CUDA-9.0 CuDNN: CuDNN-7.1 for CUDA9.1 (其实写到这里就知道肯定会出问题的) 我在安装tensorflow1.7的时候,使用的CUDA-9.1和CuDNN-7.1 for CUDA9.1,但是实际在import tensorflow的时候,提示的是找不到 libcudart.so.9.0,所以随后将CUDA-9.1卸载,再安装CUDA-9.0,在还没有更改CuDNN的版本下,成功的 import tensorflow。 在跑程序的时候,因为程序中使用到了CNN,就得到了以上的错误,看网上的说法是如果模型没有使用CNN,应该不会报错,但是我没有去尝试了。错误提示的是:CUDNN没有初始化,再下面一句话是“可能驱动版本不足”。我将CUDNN版本换成CUDNN for CUDA-9.0