本文参考http://www.vlfeat.org/matconvnet/install/,https://github.com/peiyunh/tiny,http://blog.csdn.net/wd1603926823/article/details/52370278

@article{hu2016finding,title={Finding Tiny Faces},author={Hu, Peiyun and Ramanan, Deva},journal={arXiv preprint arXiv:1612.04402},year={2016}
}

1、首先根据自己的英伟达型号去官网下载对应的英伟达驱动

我的是gtx1050,计算能力是6.1,在默认路径下安装。

2、根据自己安装的matlab版本,下载最新的对应cuda

一定要下载对应matlab版本的cuda,一开始我安装最新cuda8.0出错了,我的matlab是R2016a,重新安装了最新的cuda7.5,安装在默认路径下。

3、配置VS2013+cuda7.5

具体参考http://blog.csdn.NET/listening5/article/details/50240147

4、安装matconvnet

我用来做人脸检测,所以这里配置了Finding Tiny Faces

(1)首先下载tiny

git clone git@github.com:MarleyLee/tiny.git

(2)CPU编译  两个命令

mex -setup
vl_compilenn 

编译完之后会多了一个mex文件夹,在matlab文件夹下面

编译完之后应该有除了cudnn64_4.dll外的mexw64文件,可以看出,这些文件主要是vl_conv,vl_imreadjpeg等。这些文件是由cuda C写的,并不是由MATLAB语言写的,格式是 xx.cu。然后通过mex将这些.cu文件编译成可以由MATLAB调用的函数,也就是说mexw64就相当于MATLAB的函数文件xx.m一样了。你可以看看MATLAB下面的vl_nnconv.m,可以看到文件里面全部都是注释,这样的话,调用时咋运行的啊。原来要先编译,编译好了多了mex文件,调用时是调用mexw64文件啊。这里的cudnn64_4.dll是后面用gpu编译时用到的。

(3)GPU编译

增加cudnn,cudnn是专门针对深度学习的一个加速框架。

下载对应cuda版本的cudnn,建一个local文件夹,然后把cudnn放进去,再复制到matconvnet目录下。
将自己下载的local文件夹下的cudnn文件夹下的\cuda\include下的cudnn.h复制粘贴到你所装的CUDA根目录下的\include下(网上有说,对应的lib和bin文件夹中的文件也要这样做)。
把bin下的cudnn64_4.dll再复制到mex的文件夹下。
cd matconvnet/;
>> addpath matlab/;
>> vl_compilenn('enableImreadJpeg', true, 'enableGpu', true, 'cudaRoot', [cuda_dir],...'cudaMethod', 'nvcc', 'enableCudnn', true, 'cudnnRoot', [cudnn_dir]);
我按照自己的目录改后是这样:vl_compilenn('enableGpu',true,'cudaRoot','C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5' ,'nvcc','enableCudnn',true,'cudnnRoot','.local\cudnn-v6');
出错,说不支持计算能力61,在这里卡了两天。计算能力要设定为10的倍根据自己的机器计算能力设定最接近的10的倍数,我的是61,应该设定60,但是报错,这里我设定50,如图  arch_code = '50';

运行 vl_compilenn('enableGpu',true,'cudaRoot','C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5','nvcc','enableCudnn','true','cudnnRoot','.local\cudnn-v6');

依然报错

此处下的解决方案仅供尝试,主要是不用cudnn加速编译,或者是指定路径编译,万一有效呢!

Assuming that there is only a single copy of the CUDA toolkit installed in your system and that it matches MATLAB's version, compile the library with:

> vl_compilenn('enableGpu', true)

If you have multiple versions of the CUDA toolkit, or if the script cannot find the toolkit for any reason, specify the path to the CUDA toolkit explicitly. For example, on macOS this may look like:

> vl_compilenn('enableGpu', true, 'cudaRoot', 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5')

MatConvNet can be compiled to use a more recent version of the CUDA toolkit than the one officially supported by MATLAB. While this may cause unforeseen issues (although none is known so far), it is necessary to use recent libraries such as cuDNN.

Compiling with a newer version of CUDA requires using the cudaMethod,nvcc option. For example, on macOS this may look like:

> vl_compilenn('enableGpu', true, ...'cudaRoot', 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5', ...'cudaMethod', 'nvcc')

Use vl_compilenn with the cudnnEnable,true option to compile the library; do not forget to use cudaMethod,nvcc as, at it is likely, the CUDA toolkit version is newer than MATLAB's CUDA toolkit. For example, on macOS this may look like:

> vl_compilenn('enableGpu', true, ...'cudaRoot', 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v7.5', ...'cudaMethod', 'nvcc', ...'enableCudnn', true, ...'cudnnRoot', 'local/cudnn-rc4') ;

Using MATLAB 2016a, CUDA 7.5, and cuDNN v6:

> vl_compilenn('enableGpu', true, ...'cudaMethod', 'nvcc', ...'cudaRoot', '/opt/local/cuda-7.5', ...'enableCudnn', true, ...'cudnnRoot', 'local/cudnn-v6') ;

自己对应上面的vl_compilenn合理设置参数,然后可以成功编译。

如果无效,报错如下:

nnconv_cudnn.cu出现问题,不要改源文件,文件没问题,也不建议参考网上改什么类似temp环境变量,改来改去错误越来越多,这里我猜想是cudnn出现了问题,我尝试下载了cuda7.5-cudnn-v5.1代替原先的cuda7.5-cudnn-v6,然后成功的编译。可以发现这是对应cudnn版本不匹配问题,可以发现配置环境,发现匹配的版本是多么重要!!!

(4)运行测试

vl_testnn('gpu', true);  % vl_testnn('gpu', false) for cpu-only 

(5)Compile our MEX function in MATLAB:

>> cd utils/;
>> compile_mex; 

(6)Demo

 bboxes = tiny_face_detector('data/demo/selfie.jpg', './selfie.png', 0.5, 0.1, 1)

运行成功,说明配置成功。

win10+GPU+MATLAB+MatConvNet配置相关推荐

  1. 【caffe-windows】 caffe-master 之 matlab接口配置

    平台环境: win10 64位 caffe-master  vs2013 Matlab2016a 第一步: 打开\caffe-master\windows下的CommonSettings.props文 ...

  2. Caffe在Win10上的CPU配置以及运行第一个手写体数字识别的caffemodel

    Caffe在Win10上的CPU配置: 操作系统:Windows10 编译环境(必选):Visual Studio 2013 Ultimate版(Visual Studio 2013 Ultimate ...

  3. PostgreSQL10.5安装后(Win10)环境变量配置与运行

    一.PostgreSQL10.5安装后(Win10)环境变量配置 安装见:PostgreSQL10.5安装详细步骤(Win10) 需要设置环境变量,包括三项:data存放路径,lib以及bin目录 C ...

  4. win10下git的配置教程

    win10下git的配置教程 下载并安装git 登录git的官方网站,下载git.注意在windows,linux,mac系统上的下载版本不同,要根据自己的本地环境来选择安装包,如下图所示,这里我们选 ...

  5. 计算机主机信息怎么看,本机电脑硬件配置信息怎么看?Win7/Win10查看详细电脑配置方法...

    电脑配置决定了一台电脑的性能好坏,如果电脑配置没有达到游戏或者软件的要求,那么肯定无法流畅运行的.对于一些小白用户不知道如何查看电脑硬件配置,那么本机电脑硬件配置信息怎么看?下面装机之家小编分享一下W ...

  6. win10 + Terminal + WSL+ oh-my-zsh 配置漂亮实用的windows终端及配置ubuntu不加.exe打开windows程序

    win10 + Terminal + WSL+ oh-my-zsh 配置漂亮实用的windows终端及配置ubuntu不加.exe打开windows程序 未安装wsl/wsl2的请参照以下链接自行安装 ...

  7. hadoop服务器系统设置win10,win10系统hadoop安装配置的设置技巧

    win10系统使用久了,好多网友反馈说关于对win10系统hadoop安装配置设置的方法,在使用win10系统的过程中经常不知道如何去对win10系统hadoop安装配置进行设置,有什么好的办法去设置 ...

  8. 华为服务器gpu卡型号,gpu服务器与配置

    gpu服务器与配置 内容精选 换一换 云服务器列表页面,云服务器的状态显示为"异常".进入云服务器列表页面,鼠标移动至"异常"状态处,查看具体的异常原因.查看异 ...

  9. mysql zip win10安装_mysql 8.0.16 Win10 zip版本安装配置图文教程

    本文为大家分享了mysql 8.0.16  Win10 zip版本安装配置图文教程,供大家参考,具体内容如下 首先去mysql官网下载mysql最新版本 1.选择如图所示 community 2.点击 ...

最新文章

  1. java 进程睡眠_Linux进程的睡眠和唤醒简析
  2. Linux下的Shell工作原理
  3. Shell脚本判断IP是否合法性(多种方法)
  4. golang管道channel的遍历和关闭:应该使用for...range来遍历
  5. centos 7 修复mysql,快速修复Centos7 系统时区!
  6. Spring Boot定时任务-Job类对象注入
  7. 那些年我们一起追过的大佬
  8. linux shell跳板机,用shell开发跳板机
  9. 可以供MFC调用的,QT实现的DLL(qtwinmigrate实现)
  10. PAT乙级(1023 组个最小数)
  11. mysql 删除版本信息_mysql5.5版本删除大表
  12. html页面性能优化两则
  13. 配置sharepoint站点为Form认证(下)
  14. 【Linux】C语言——贪吃蛇
  15. 林轩田机器学习基石和技法资源
  16. Android studio 制作一个app实现简单功能
  17. Photoshop插件-黑白(一)-脚本开发-PS插件
  18. 微信小程序实现自动定位
  19. Unicode编码的字块,Unicode不同范围对应的不同语言的字符集
  20. 新浪微博僵粉(机器粉)识别方法

热门文章

  1. 俞渝年轻图片_组图:2007中国职场女性榜样-俞渝
  2. 低版本360浏览器下,PDF.js部分文字显示不全的问题
  3. 送别了我的师父,我觉得我的青春结束了
  4. android第三方开发包(十七)
  5. 金盾加密视频提取翻录为mp4教程
  6. 【无标题】java核心资料
  7. Excel自动输入当前时间的公式
  8. 纯国产环境JAVA程序(Springboot + Mybatis + 达梦数据库)搭建
  9. WordPress使用SQL语句批量替换失效的蓝奏云下载地址
  10. win10自带sftp服务器_FreeSSHD在Windows环境下搭建SFTP服务器