配置:win7_64bit+VS2013
准备工作:下载微软官方提供的caffe安装包,下载地址:https://github.com/Microsoft/caffe,下载完毕解压到目标文件夹即可,笔者放置在E盘根目录中。
一、修改配置文件
打开E:\caffe-master\caffe-master\windows,找到CommonSettings.props.example文件复制(原文件作为备份)更改文件名为CommonSettings.props,该文件为caffe的配置文件(GPU/CPU、Python接口、Matlab接口均在该文件中进行配置),用VS打开并更改该文件内容如下,相关内容见注释。
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<BuildDir>$(SolutionDir)..\Build</BuildDir>
<!--NOTE: CpuOnlyBuild and UseCuDNN flags can't be set at the same time.-->
<CpuOnlyBuild>true</CpuOnlyBuild> //true为CPU版,false为GPU版
<UseCuDNN>false</UseCuDNN> //是否使用Cudnn加速,当CPU版时设置为false
<CudaVersion>7.5</CudaVersion> //Cuda版本设置
<!-- NOTE: If Python support is enabled, PythonDir (below) needs to be
set to the root of your Python installation. If your Python installation
does not contain debug libraries, debug build will not work. -->
<PythonSupport>false</PythonSupport> //是否支持Python,设置为true后面需设置相应Python安装路径
<!-- NOTE: If Matlab support is enabled, MatlabDir (below) needs to be
set to the root of your Matlab installation. -->
<MatlabSupport>false</MatlabSupport> //是否支持Matlab,设置为true后面需设置相应Mat