编译环境:
windows8.1
Anaconda python2.7
Visual studio 2012
CUDA6.0
Pthread for windows
Intel Math Kernel Library
 
cuda-convnet 原始文件下载地址:
 
其中用到的一些库:

PThread 下载链接:

Intel® Math Kernel Library 下载链接:(下载windows版本)
cuda-convnet 工程文件下载链接:
其他一些有用的工具:(下载x64的版本,调试的时候可能用到)
 
因为cuda-convnet需要python27,所以必须下载python27的库安装上. 我用的是Anaconda自带的python库.
 
第一步:
把下载下来的cuda工程文件解压至trunk目录下,然后用记事本打开pyconvnet.vcxproj文件
然后把版本号修改为正确的版本号,我的是把cuda4.0  修改为cuda6.0
 
第二步:
编译时会遇到以下问题,那是头文件没包含对的缘故,不用担心
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 6.0.targets(597,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2012 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin"  -I./ -I../../../common/inc -I../../../../shared/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -I./ -I../../common/inc -I../../../shared/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include"  -G   --keep-dir Debug -maxrregcount=0  --machine 32 --compile -cudart static  -g   -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MTd  " -o Win32/Debug/convnet.cu.obj "E:\synchronize folder\Koder Quelle\deep learning\cuda-convnet\trunk\src\convnet.cu"" exited with code 2.
针对这些错误只要设置好相应的依赖库就可以了.
 
第三步:
最后编译生成的是dll,后缀名为pyd, 这样方便python调用.
 
第四步:
从下面的地址下载cifar-10图片数据
 
第五步:
在VS环境中设置环境变量
 
第六步:
在命令行中输入如下命令:
python convnet.py --data-path=./storage2/tiny/cifar-10-batches-py-colmajor/ --save-path=./storage2/tmp --test-range=6 --train-range=1-5 --layer-def=./example-layers/layers-19pct.cfg --layer-params=./example-layers/layer-params-19pct.cfg --data-provider=cifar --test-freq=13 --epoch=200
 
训练的时候发现一个比较坑的问题就是这两个错误:
1.raise UnpickleError("Path '%s' does not exist." % filename)
util.UnpickleError: Path 'D:/cuda-convnet/storage2/tiny/cifar-10-batches-py-colmajor/data_batch_6' does not exist.
2.self.data_mean = self.batch_meta['data_mean']
KeyError: 'data_mean'
原因是batches_meta文件格式不对,这个必须去下载对应的cifar-10的数据,而且带有合乎要求格式的文件,下面给上链接:
 
即使找到合适的数据,还可能出现以下的错误:
self.libmodel = __import__(lib_name)
ImportError: No module named convnet_
解决方案就是在convnet.py的46行把'convnet_'库改成对应的'pyconvnet'
 
 
解决了以上的问题以后差不多应该能够顺利的运行程序了.
 
 
编译时遇到的错误及解决方案:
 
fatal error C1083: Cannot open include file: 'cblas.h': No such file or directory
解决方案:
属性页/C++/Preprocessor/Preprocessor definitions/加入USE_MKL;
 
neuron.cuh(104): error : identifier "PyObject" is undefined
解决方案:
属性页/C++/Preprocessor/Preprocessor definitions/加入NUMPY_INTERFACE;
 
编译的时候提示找不到pthread.h文件:
解决方案:
在trunk中加入下载好的pthread文件夹,并正确的包含头文件和库文件
 
编译的时候报error : identifier "pthread_mutex_t" is undefined错误:
解决方案:
在nvmatrix.cuh文件里加上<pthread.h>
 
LINK : fatal error LNK1104: cannot open file 'cutil64D.lib'
解决方案:
去掉cutil64D.lib
 
LINK : fatal error LNK1104: cannot open file 'shrUtils64D.lib'
解决方案:

去掉shrUtils64D.lib

 
一些参考来源:
http://vision.group.shef.ac.uk/wordpress/?p=1
http://personal.ie.cuhk.edu.hk/~xy012/others/install_cudaconvnet.html
https://code.google.com/p/cuda-convnet/wiki/TrainingNet

cuda-convnet windows8下编译的更多相关文章

  1. ubuntu下编译caffe

    Ubuntu下编译caffe 纯粹是个人编译的记录.不用CUDA(笔记本是amd卡,万恶的nvidia):不手动编译依赖包(apt-get是用来干啥的?用来直接装二进制包,以及自动解决依赖项的) ca ...

  2. 在CUDA8.0下编译安装OpenCV3.1.0来实现GPU加速(Compiling OpenCV3.1.0 with CUDA8.0 support)

    在CUDA8.0下编译安装OpenCV3.1.0 一.本人电脑配置:ubuntu 14.04, NVIDIA GTX1060. 二.编译OpenCV3.1.0前,读者需要成功安装CUDA8.0(网上有 ...

  3. [转]CUDA在Windows下的软件开发环境搭建

    引自:http://www.makaidong.com/yaoyuanzhi/archive/2010/11/13/1876215.html 本文我们以visual studio 2005 为例演示c ...

  4. Win10 在 CUDA 10.1 下跑 TensorFlow 2.x

    深度学习最热的两个框架是 pytorch 和 tensorflow,pytorch 最新版本是 1.3,tensorflow 最新版本为 2.0,在 win10 下 pytorch 1.3 要求的 c ...

  5. 不要着急改代码,先想想--centos 6.8下编译安装tmux

    诸位读者新年好,2017开年第一篇博客,请允许我先问候一下看到这篇博客的诸位.写博客是我2017年定下的目标之一,希望我会坚持下去. 最近打算尝试一下tmux这个神器,于是有了这一篇关于思维方式的Bl ...

  6. [转] Windows下编译OpenSSL

    简述 OpenSSL是一个开源的第三方库,它实现了SSL(Secure SocketLayer)和TLS(Transport Layer Security)协议,被广泛企业应用所采用.对于一般的开发人 ...

  7. linux下编译gcc6.2.0

    linux下编译gcc6.2.0 在archlinx的下gcc已经更新到6.2.1了,win10的WSL下还是gcc4.8.官方源没有比较新的版本,于是自己编译使用. GCC6的几个新特性 GCC 6 ...

  8. centos下编译安装lnmp

    centos下编译安装lnmp 本文以centos为背景在其中编译安装nginx搭建lnmp环境. 编译安装nginx时,需要事先安装 开发包组"Development Tools" ...

  9. libCURL开源库在VS2010环境下编译安装,配置详解

    libCURL开源库在VS2010环境下编译安装,配置详解 转自:http://my.oschina.net/u/1420791/blog/198247 http://blog.csdn.net/su ...

随机推荐

  1. Android深度探索--HAL与驱动开发----第六章读书笔记

    Linux驱动程序与其他类型的Linux程序一样拥有自己的规则,下面给出一个编写基本的Linux驱动的一般步骤: (1)建立Linux驱动的骨架(装载和卸载Linux驱动): (2)注册和注销设备文件 ...

  2. C#面向对象概念之继承

    //经常讲到继承.重载,但还是有人概念比较模糊,因此想写个例子加深理解 interface ILog { void WriteLine(string message); } class LogBase ...

  3. select2插件

    引入select2插件<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min. ...

  4. PAT 1072. Gas Station (30)

    A gas station has to be built at such a location that the minimum distance between the station and a ...

  5. canvas转盘抽奖

    1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" ...

  6. Microsoft Visual C++ Compiler for Python 2.7

    Extest.c文件:#include <stdio.h> #include <stdlib.h>#include <string.h>#include " ...

  7. sql语句查询结果添加排序列(转)

      给查询出的SQL记录添加序号列,解决方法有以下两种 第一: select ROW_NUMBER() OVER (ORDER BY a.字段 ASC) AS XUHAO,a.* from table ...

  8. SE Homework 1 —An Error Impressed Me

    在对两个对象进行比较.判断是否相等时,直接用 == 放在两个对象中间,例如下面的代码: Infor i1 = new Infor(111,"AA"); Infor i2 = new ...

  9. HDU 1863

    http://acm.hdu.edu.cn/showproblem.php?pid=1863 复习考研练练写Prim,第一次写,乱搞的,有点难看 邻接表+堆 #include <iostream ...

  10. 微信公众号红包接口开发PHP开发 CA证书出错,请登陆微信支付商户平台下载证书

    微信红包接口调试过程中一直提示“CA证书出错,请登陆微信支付商户平台下载证书”,经反复调试,大致解决方法如下: 1.首先确保CA证书的路径是否正确,一定得是绝对路径,因为是PHP开发的,这里需要三个p ...