由于某些原因,需要在windows下配置caffe,基本上是按照caffe的windows分支的readme上写的安装的。大致说一下流程:
https://github.com/BVLC/caffe/tree/windows
1、 安装准备
VS2015,python3.5,matlab2017a,cuda8和cudnn。注意python版本不能是3.6,目前仅支持到3.5。我在安装的时候是装的最新的anaconda3,其带的python版本是3.6,导致不匹配。此时可以用conda create再安装一个3.5的环境,或是卸载重新安装anaconda3-4.2.0版本,带的是python3.5.2版本。
Anaconda官网下载很慢,推荐清华镜像源网站:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
另外安装cmake和ninja,记得添加到path环境变量:
https://cmake.org/
https://ninja-build.org/
2、 下载caffe的windows分支:
git clonehttps://github.com/BVLC/caffe.git
cd caffe
git checkout windows
如果git慢,直接zip下载后解压吧…
3、 确认存在文件%CAFFE_ROOT%/scripts/build_win.cmd,修改69~100行:
) else (
if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14
if NOT DEFINED WITH_NINJA set WITH_NINJA=0
if NOT DEFINED CPU_ONLY set CPU_ONLY=0
if NOT DEFINED CUDA_ARCH_NAME set CUDA_ARCH_NAME=Auto