Win7 compiling the Matlab interface for the Microsoft version of the Caffe package (CPU mode)

Source: Internet
Author: User

This blog is based on http://www.cnblogs.com/njust-ycc/p/5776286.html this blog modified, made a correction and supplement.

The environment of my machine: win7+matlab2014b+vs2013

1. First go to GitHub to download Microsoft's Caffe package, address: Https://github.com/microsoft/caffe

After downloading, unzip to get:

Copy the CommonSettings.props.example under the Caffe-master\windows path and change the suffix name to. props

2. Go in to find the Windows folder, go to the Windows folder, locate the Caffe.sln file, which is the project file to open, as follows:

3. Open the Caffe.sln project file using vs2013, open the following directory file as follows:

4. Because there is no GPU configuration, and also to compile the Matlab interface, first to modify the props directory of the Commonsettings.props configuration file, this is:

Open the configuration file, modify the following: Because we are configured under the CPU, and support Matlab interface, other places do not modify.

To modify the root directory of a MATLAB installation:

This is because the Microsoft GitHub seems to have updated the Caffe_.cpp file in Matcaffe, and the 16th line adds a reference to Gpu/mxgpuarray.h, and you can add Matlabdir to the Includepath of this step.

Modify the 16th line in Matcaffe in Caffe_.cpp #include"Gpu/mxgpuarray.h" to

5. Almost the modified file has been modified, and then we start to compile, choose Release mode, (of course, debug line)

Right-click the Matcaffe project and click Regenerate

Note that because this version of the Caffe-windows package, do not need to download the third-party library, it will automatically download, the process is slow, so the first time the compilation will automatically download the third-party library, wait patiently.

After downloading, there is one more in the Caffe-windows folder:

Open can see there are 16 folders, these are third-party dependent libraries

After downloading, you should continue compiling, wait a few minutes, until the compilation is successful.

6. After the compilation is successful, we enter the following directory:

You can see that the Matcaffe folder and the Caffe.exe executable have been successfully generated, as well as some other dependent files, Caffe.exe is used for network training.

Open the Matcaffe folder, enter the +caffe, and then enter private, if the successful generation of caffe_mexw64 files, the MATLAB interface configuration is successful.

7. Finally we test in MATLAB, (here can also refer to the next http://blog.csdn.net/zb1165048017/article/details/51702686 this blog, "The fourth Step" after ~)

First add the system path: The path depth to the Release directory, for example, I here is e:\ scientific research \deep-learning\caffe-windows\caffe-windows\build\x64\release,

Then open matlab2015a, add path, path depth to Matcaffe directory, for example, I here is e:\ research \deep-learning\caffe-windows\caffe-windows\build\x64\ Release\matcaffe

after saving, restart Matlab, otherwise the test will not find the Caffe_mexw64 module error.

Enter a function as a test in the console:

Caffe.reset_all ();

You can see the following:

Indicates that the MATLAB interface can be used.

Win7 compiling the Matlab interface for the Microsoft version of the Caffe package (CPU mode)

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.