Resolving the No module name _caffe problem that occurs when Python is in import Caffe

Source: Internet
Author: User

These two days of graduation design to use the Caffe, in the image preprocessing to call the Python Caffe interface, the results appear

ImportError: No module named _caffe

So I found a variety of solutions on the Internet, and finally discovered that this was the pit I left when I installed and configured Caffe:

Here quote http://blog.sina.com.cn/s/blog_74f32c400102wjli.html This blog post, I read this article only understand, I was too lazy at that time not configured Caffe interface

After compiling the Libcaffe , you can then compile the entire solution. If there is no problem,theCaffe is compiled. According to the official steps, if you want to use matlab and python interface, the following settings.

MATLAB:

1. Add the generated Matcaffe folder to the matlab search Path, as shown in.

2. Add the compiled release folder to the environment variable, and here I am

G:\caffe\caffe-windows\Build\x64\Release, shown.

Python:

There are two methods, one is the new name of the environment variable named PythonPath, the value is

G:\caffe\caffe-master-MS\Build\x64\Release\pycaffe, shown.

The second is to directly

Copy the Caffe folder under the G:\caffe\caffe-master-MS\Build\x64\Release\pycaffe folder to python of the Site-packge directory, as shown in.

Both ways, I've done it.

Finally, restart the computer, you can use Caffe and its matlab and python interface.

Resolving the No module name _caffe problem that occurs when Python is in import Caffe

Related Article

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.