Caffe Windows compilation

Source: Internet
Author: User

First, the compilation environment

1. Download Caffe Windows edition source code

Https://github.com/BVLC/caffe/tree/windows

2.CUDA

Cuda 7.5 or 8.0 (use Cuda 8 if using Visual Studio 2015)

3.cuDNN V5

Copy the downloaded Bin,include and Lib to the CUDA corresponding directory (my: C:\Program files\nvidia GPU Computing toolkit\cuda\v7.5).

4.Matlab

r2016b (my version)

5.Anaconda Python 2.7

Https://conda.io/miniconda.html

After downloading, double-click the executable program to install to C:\MINICONDA2.

After installation, start Cmd.exe, enter Conda list to see some installation packages;

Update Conda Package

Conda Update Conda

Installing NumPy

Install NumPy

Second, compile

Enter the Caffe\windows directory, copy the CommonSettings.props.example file to Commonsettings.props (the bold part is the modification), the contents are as follows

<?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 is set at the same time.-->        <CpuOnlyBuild>true</CpuOnlyBuild> <UseCuDNN>false</UseCuDNN><CudaVersion>7.5</CudaVersion> <!--note:if python support was 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 won't work. -<PythonSupport>true</PythonSupport><!--note:if matlab support was enabled, Matlabdir (below) needs to BES set to the root of your Matlab installation . -<MatlabSupport>true</MatlabSupport><CudaDependencies></CudaDependencies> <!--Set CUDA architecture suitable foryour GPU. Setting proper architecture is important to mimize your run and compile Time. -<CudaArchitecture>compute_35,sm_35;compute_52,sm_52</CudaArchitecture> <!--CuDNN4and5is supported--<cudnnpath>$ (cuda_path) </CuDnnPath><scriptsdir>$ (solutiondir) \scripts</scriptsdir> </PropertyGroup> <propertygroup condition="' $ (cpuonlybuild) ' = = ' false '"> <CudaDependencies>cublas.lib;cuda.lib;curand.lib;cudart.lib</CudaDependencies> </propertygro Up> <propertygroup condition="' $ (usecudnn) ' = = ' true '"> <cudadependencies>cudnn.lib;$ (cudadependencies) </CudaDependencies> </PropertyGroup> &L T PropertyGroup condition="' $ (usecudnn) ' = = ' true ' and $ (cudnnpath)! = '"> <librarypath>$ (Cudnnpath) \lib\x64;$ (LibraryPath) </LibraryPath> <includepath>$ (Cudnnpa TH) \include;$ (includepath) </IncludePath> </PropertyGroup> <PropertyGroup> <outdir>$ (B Uilddir) \$ (Platform) \$ (Configuration) \</outdir> <intdir>$ (BuildDir) \int\$ (ProjectName) \$ (Platform) \ $ (Configuration) \</intdir> </PropertyGroup> <PropertyGroup> <librarypath>$ (OutDir); $ ( Cuda_path) \lib\$ (Platform), $ (LibraryPath) </LibraryPath> <includepath>$ (SolutionDir): \include;$ (SolutionDir): \include\caffe\proto;$ (Cuda_path) \include;$ (includepath) </IncludePath> </PropertyGroup> < PropertyGroup condition="' $ (pythonsupport) ' = = ' true '"> <PythonDir>C:\Miniconda2</PythonDir> <librarypath>$ (pythondir) \libs;$ (LibraryPath) &lt ;/librarypath> <includepath>$ (pythondir) \include;$ (pythondir) \lib\site-packages\numpy\core;$ (Includepath) </IncludePath> </PropertyGroup> <propertygroup condition="' $ (matlabsupport) ' = = ' true '"><matlabdir>c:\program files\matlab\r2016b</matlabdir><librarypath>$ (Matlabdir) \extern\lib\win64\microsoft;$ (LibraryPath) </LibraryPath> <includepath >$ (Matlabdir) \extern\include;$ (matlabdir) \toolbox\distcomp\gpu\extern\include; $ (Includepath) </IncludePath> </PropertyGroup> <itemdefinitiongroup condition="' $ (cpuonlybuild) ' = = ' true '"> <ClCompile> <preprocessordefinitions>cpu_only;% ( preprocessordefinitions) </PreprocessorDefinitions> </ClCompile> </ItemDefinitionGroup> < ItemDefinitionGroup condition="' $ (usecudnn) ' = = ' true '"> <ClCompile> <preprocessordefinitions>use_cudnn;% ( preprocessordefinitions) </PreprocessorDefinitions> </ClCompile> <CudaCompile> & lt;defines>use_cudnn</defines> </CudaCompile> </ItemDefinitionGroup> <itemdefinitiong Roup condition="' $ (pythonsupport) ' = = ' true '"> <ClCompile> <PreprocessorDefinitions>WITH_PYTHON_LAYER; boost_python_static_lib;% ( preprocessordefinitions) </PreprocessorDefinitions> </ClCompile> </ItemDefinitionGroup> < ItemDefinitionGroup condition="' $ (matlabsupport) ' = = ' true '"> <ClCompile> <preprocessordefinitions>matlab_mex_file;% ( preprocessordefinitions) </PreprocessorDefinitions> </ClCompile> </ItemDefinitionGroup> < Itemdefinitiongroup> <ClCompile> <MinimalRebuild>false</MinimalRebuild> <MultiProcessorCompilation>true</MultiProcessorCompilation> <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS; USE_OPENCV; USE_LEVELDB; use_lmdb;% ( preprocessordefinitions) </PreprocessorDefinitions> <TreatWarningAsError>true</TreatWarningAsError> </ClCompile> </ItemDefinitionGroup> <itemdefinitiongroup conditio n="' $ (Configuration) |$ (Platform) ' = = ' release|x64 '"> <ClCompile> <Optimization>Full</Optimization> <preprocessordefiniti ons>ndebug;% ( preprocessordefinitions) </PreprocessorDefinitions> <runtimelibrary>multithreadeddll</runtimelibr Ary> <FunctionLevelLinking>true</FunctionLevelLinking> </ClCompile> <Link> <EnableCOMDATFolding>true</EnableCOMDATFolding> <GenerateDebugInformation>true</GenerateDebugInformation> <linktimecodegeneration>uselinktimecodegeneration</linktimecodegener Ation> <OptimizeReferences>true</OptimizeReferences> </Link> </ItemDefinitionGroup> <itemdefinitiongroup condition="' $ (Configuration) |$ (Platform) ' = = ' debug|x64 '"> <ClCompile> <Optimization>Disabled</Optimization> <preprocessordefi nitions>_debug;% ( preprocessordefinitions) </PreprocessorDefinitions> <runtimelibrary>multithreadeddebugdll</runtim elibrary> </ClCompile> <Link> <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup></Project>

  

Caffe Windows compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.