官网配置文档见:GitHub - BVLC/caffe at windows
进入 windows cmd 命令行,执行如下操作:
C:\Projects> git clone https://github.com/BVLC/caffe.git C:\Projects> cd caffe C:\Projects\caffe> git checkout windows :: Edit any of the options inside build_win.cmd to suit your needs C:\Projects\caffe> scripts\build_win.cmd注: issue with build_win.cmd #5338
如果不识别 git 命令,则需要在 windows 下安装 (git for windows),并将 bin 添加进环境变量;尤其注意,执行 git checkout windows(切换 windows 分支)之后,文档中的英文说明,需要根据自己的主机环境配置修改 scripts\build_win.cmd 文件;主要修改如下:
set WITH_NINJA=1 ⇒set WITH_NINJA=0,以使用 visual studio generator在 cmake 命令的倒数第二行,添加如下的两行,以人为指定C和C++编译器: -DCMAKE_C_COMPILER=cl.exe ^ -DCMAKE_CXX_COMPILER=cl.exe ^