Caffe compiled under Window (Windows7, Cuda8.0,matlab interface Compilation)

Source: Internet
Author: User

1. Environment: windows7,cuda8.0, Graphics gtx1080,matlab2016a,vs2013 (PS: The boss said the server to install Windows system, no way, but also toss some)

2. Download Caffe Package: Https://github.com/BVLC/caffe/tree/windows

Follow the command line on GitHub:

projects here is their own local new folder, anywhere, if Git is not installed, first install git, Baidu git can.

After executing the first 3 commands, the Caffe package is downloaded.

before you run Build_win.cmd, you need to modify several places:

A. If it is VS2013, change the msvc_version=14 to 12

B. Here I compiled the MATLAB interface, the build_matlab=0 is modified to 1,

you do not need to compile the PYTHON interface, so Build_python is modified to 0,build_python_layer modified to 0.

C. The currently downloaded Caffe package is unable to compile the Matlab interface, need to modify 3 files, detailed reference the following connection:

https://github.com/BVLC/caffe/pull/4928/commits/a5e7b32f1cdbfe05a6bb3037a86409975a8b6a7b

Copy the file directly and replace it.

3. When the last run Scripts\build_win.cmd, there will be some errors, the following main analysis of the workaround:

(1) Because the Scripts folder has a. py file that downloads a dependent library, the Python environment is required to run, so

Also install the python,2.7 version to configure the system environment variables. Run again, and then you will also be prompted to find the module six Yaml, these are the modules that need Python to introduce, Baidu a bit

It can be installed by easy_install.py.

(2) Cmake, the most important compilation environment, download version 3.4, install, configure the system environment variables.

(3) Compiling MATLAB interface requires local MEX tool, need to configure MATLAB environment variable.

4. After the run will download the dependent library, will generate a local build folder, the download process is slow, wait patiently.

A. If the next half of the error, when re-run Build_win.cmd, you will be prompted to delete the build folder, you can delete.

B. If you have downloaded the dependent packages, in order to avoid re-download, first of all, the build_win.cmd inside the Judgment build folder is the existence of code comments out,

Then open the download dependent Library of the. py file, the inside of a row to download the code comment of the dependency package, but you need to modify the dependency package path to a locally stored path (because the code will resolve the dependency package, the modified path variable is dep_filename, directly replace the variable with a local path), By repeating the compilation, the package will not be re-downloaded.

5. The compilation process is long, after completion, in the Caffe\tools\release directory, there are various executable files, but the operation will be error, the lack of various DLL files,

Need to go to other folders to find the corresponding DLL file, copy to the release directory.

Matlab interface compiled, is in the Caffe\matlab\+caffe\private\release directory, there are caffe_mexw64 files.

Test, to set the Caffe\matlab to the MATLAB search path, the Caffe_mexw64 file will be copied to the current working directory.

Caffe compiled under Window (Windows7, Cuda8.0,matlab interface 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.