CentOS7 installation Caffe2

Source: Internet
Author: User
Tags git clone
Install Epel
$ sudo yum install Epel-release
installing a dependent system library
# $ sudo yum update
$ sudo yum install-y \
automake \
cmake3 \
gcc \
gcc-c++ \
git \
kernel-d EVEL \
leveldb-devel \
lmdb-devel \
libtool \
protobuf-devel \
python-devel
\ PYTHON-PIP \
snappy-devel \
gflags-devel \
glog-devel
Installing a dependent Python library
$ sudo pip install--upgrade pip
$ sudo pip install \
flask \
future \
graphviz \
hypothesis \
  jupyter \
matplotlib \
numpy \
protobuf \
pydot \
python-nvd3 \ Pyyaml
\ Requests \
scikit-image \
scipy \
setuptools \
six \
tornado
Compile and install Caffe2
$ git clone--recursive https://github.com/caffe2/caffe2
$ cd caffe2 && mkdir build
$ cd Build && ; Cmake3.
. $ sudo make install
Test

First use the following command to check if CAFFE2 is installed successfully

$ CD Build
$ Python-c ' from Caffe2.python import core ' 2>/dev/null && echo ' Success ' | | echo ' failure '

If the Caffe2 installation succeeds, the above command should print Success.

Second, use the following command to run a test

$ CD Build
$ python-m caffe2.python.operator_test.relu_op_test
$ python-m caffe2.python.operator_ Test.weighted_sample_test
$ python-m caffe2.python.examples.resnet50_trainer--train_data null--use_cpu True
problem Question one

Run "python-m caffe2.python.operator_test.relu_op_tes" error

...
Traceback (most recent):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__" Main__ ", fname, loader, pkg_name)
  File"/usr/lib64/python2.7/runpy.py ", line-, in _run_code
    exec-code in RUN_GL Obals
  File "/home/jhadmin/downloads/caffe2/build/caffe2/python/operator_test/relu_op_test.py", line < Module>
    from hypothesis import given
  File "/usr/lib/python2.7/site-packages/hypothesis/__init__.py", <module> from
    Hypothesis.core Import given, find, example, Seed, reproduce_failure, \
  File "/usr /lib/python2.7/site-packages/hypothesis/core.py ", line-<module> from
    coverage.files Import Canonical_filename
importerror:cannot Import name Canonical_filename

The problem is the coverage version of Python, upgrading the coverage library

sudo pip install coverage--upgrade
question two

Run "python-m caffe2.python.operator_test.relu_op_tes" error

Attributeerror: ' Module ' object has no attribute ' full '

Problem is NumPy version problem, upgrade NumPy library

sudo pip install numpy--upgrade

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.