Verify that Caffe is configured correctly under Windows

Source: Internet
Author: User

Verify that Caffe is configured correctly under Windows: (Note: Do not consider the build environment of Caffe, but directly use the binary files provided by the Caffe website)

Windows version source and binary library files:https://github.com/BVLC/caffe/tree/windows

#encoding: Utf-8

Import NumPy as NP;
Import Sys,os;
Note The following directory structure, according to their own actual situation can be modified
caffe_root= ' d:/env/caffe/caffe/';
Sys.path.insert (0, caffe_root + ' python ');
Import Caffe as CA; # introduce your own Caffe Python interface
Print ("######"); # Python Print 6 #
Import Matplotlib.pyplot as PLT;
Plt.plot ([1,2,3,4], [1,2,3,4]);
Plt.show (); # Draw a straight line of 45°
Ca.set_mode_gpu (); #设置使用GPU, Ca.set_mode_cpu ();
Print ("Finish Set_mode_gpu.")

# The following 5 lines verify that the interface under the Python directory can be referenced normally
Import Caffe.io as Cai;
Import Caffe.net_spec as can;
Import Caffe.classifier as CAC;
Import Caffe.draw as CAD; # This file needs to install the Pydot component
Import Caffe.coord_map as Caco;

Print ("All OK")

Dependent Installation Instructions:

Using anaconda4.2.0, or python3.5, has actually inherited worked tools such as Numpy,scipy,sklearn.

Also missing dependencies are: Pydot, but in the python3.5 platform recommended the use of Pydotplus, not Pydot, otherwise will error.

In addition, use PIP to reinstall Graphviz on the basis of installing Pydotplus.

Note: for the test here, just install Graphviz with PIP. However, in some cases (in most cases), the Graphviz tool should be installed independently. :http://www.graphviz.org/Download_windows.php

Verify that Caffe is configured correctly under Windows

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.