编译环境
环境搭建
- %INTEL_DEV_REDIST%redist\intel64\compiler;%INTEL_DEV_REDIST%redist\ia32\compiler;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\libnvvp;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;c:\python27;
这些都注意加入路径。
建立工程文件
- /*
- Dummy Includes for cutil_inline.h
- Wei LI <kuantkid <at> gmail <dot> com>
- */
- #include <helper_cuda.h>
- #define cutilCheckMsg(a) getLastCudaError(a)
- #define cutGetMaxGflopsDeviceId() gpuGetMaxGflopsDeviceId()
- #define MIN(a,b) (a) < (b) ? (a) : (b)
)
编译生成了pyconvnet.pyd文件。还没完,依赖的dll还没有加入。使用depends软件可以看到pyconvnet.pyd存在两个黄叹号,即没有找到的依赖。找到mkl_core.dll,mkl_intel_thread.dll,pthreadVC2_x64.dll放入Release文件夹中就OK了。
cmd进入Release目录,输入python进入python命令行,输入import pyconvnet没有报错那就完成90%了。
进入cuda-convnet-read-only,将pyconvnet.pyd放入。进入cuda-convnet-read-only\bin目录,新建windows文件夹,将mkl_core.dll,mkl_intel_thread.dll,pthreadVC2_x64.dll拷入文件夹中,加入系统环境变量。
万事俱备,依照https://code.google.com/p/cuda-convnet/wiki/TrainingNet,我们输入命令
- python convnet.py --data-path=I:\\cifar-10-py-colmajor --save-path=./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
哈哈,出结果啦~~如图:
8906



被折叠的 条评论
为什么被折叠?



