win10+cuda8.0+cudnn5+caffe configure caffe (GPU) framework (with common compilation errors and solutions)

@[TOC](win10+cuda8.0+cudnn5+caffe configure caffe (GPU) framework)

Ready to work

It is best to install in accordance with the following configuration, there may be incompatibility with other versions

Download from cudnn official website:
Please add picture description
Please add picture description
Please add picture description
Please add picture description

Installation link (it is better not to have Chinese path)

  • Python installation just follow the installation file, remember to add the path to the environment variable
  • vs2013 If you downloaded it in the link, please refer to here to reprint the
    Visual Studio Ultimate 2013 KEY (key): BWG7X-J98B3-W34RT-33B3R-JVYW9
  • The cuda installation also follows the installation files, just streamline the installation directly
  • After decompressing the cudnn compressed package, move the three folders in the \cudnn-8.0-windows10-x64-v5.1\cuda path to the same level as the cuda folder
  • Caffe directly decompress

caffe configuration

  • Make a copy of CommonSettings.props.example under the \windows path, paste the copy file in the original path and change it to CommonSettings.props
  • Open the CommonSettings.props file with vs2013 and modify the configuration (here, take GPU+python+matlab as an example, if you don’t need one of them, just change that one to false)

will

<CpuOnlyBuild>false</CpuOnlyBuild>
<UseCuDNN>true</UseCuDNN>
<CudaVersion>7.5</CudaVersion>

To

<CpuOnlyBuild>false</CpuOnlyBuild>
<UseCuDNN>true</UseCuDNN>
<CudaVersion>8.0</CudaVersion>

If you use python
will

<PythonSupport>false</PythonSupport>

To

<PythonSupport>true</PythonSupport>

Change the following

<PythonDir>C:\Miniconda2\</PythonDir>

Change the path to the python path in your computer (example:

<PythonDir>C:\ProgramData\Anaconda2\</PythonDir>

If you use matlab
will

<MatlabSupport>false</MatlabSupport>

To

<MatlabSupport>true</MatlabSupport>

Matlab path below

<MatlabDir>C:\Program Files\MATLAB\R2014b</MatlabDir>

Change to the path of matlab in your computer (example:

<MatlabDir>E:\matlab</MatlabDir>

Add cudnn path
will

<CuDnnPath></CuDnnPath>

Change to (example:

<CuDnnPath>E:\A_Win10\下载\cudnn-8.0-windows10-x64-v5.1</CuDnnPath>

At this point, the configuration file is modified

caffe compilation

  • Use vs2013 to open the caffe.sln file in \windows under the caffe related folder
  • Right-click on the caffe file and set it as the startup program
  • Right-click on caffe libcaffe matcaffe pycaffe respectively-Properties-C/C++, change (treat warnings as errors) to No
  • Change the compilation mode to Release X64
  • Change Nuget source (the download speed of official source is very slow) domestic source address
    Steps:
    vs2013-Tools-NuGet Package Manager-Package Manager Settings-Package Source
    Add a new package source in it (the name is arbitrary, the source is the corresponding Source address), and adjust the priority
    Insert picture description here
  • Compile the project, if the compilation passes, then run to generate the corresponding file. (Solutions to common compilation errors will be attached later)
  • After compiling and running, a caffe.exe file will be generated under the path \caffe-master\Build\x64\Release
  • Add the full path of \caffe-master\Build\x64\Release (for example: E:\A_Win10\download\caffe-master\Build\x64\Release) to the system environment variables (this computer-properties-advanced system settings-environment Variables-the system variables below find Path-edit-new-paste the above path) and you are done
  • Verify that caffe is installed successfully: win+R–> cmd call up the command prompt and enter caffe to run. If the following content appears, the framework is built:
    Insert picture description here

If you fail to download the NUGet package, try several times. Restart the computer after building the framework

Common compilation errors and solutions

Libcaffe and test_all failed to load:
there may be a problem with the cuda and cudnn versions, caffe only supports cudnn 4 or 5

The error prompts that the header file cannot be opened.
Find the full path of the corresponding header file locally on the computer, and replace the header file path in the error location while compiling

Other problems can be searched directly in the browser, and there are various solutions released by csdn

Guess you like

Origin blog.csdn.net/qq_39632866/article/details/109428130