Deep Learning Framework Caffe installation process on MacOS Heigh Sierra

Source: Internet
Author: User
Tags install homebrew git clone

First step, install dependent library
Install -VD snappy leveldb gflags glog szip lmdbbrew tap homebrew/install C5>install protobuf Boost

Step two, compile Caffe
git clone https://github.com/bvlc/caffe.gitcd Caffemake make make Runtest

Question one:

inch file included from Src/caffe/common. CPP:7file included from./INCLUDE/CAFFE/COMMON.HPP:. /INCLUDE/CAFFE/UTIL/DEVICE_ALTERNATE.HPP:'cublas_v2.h' file  <cublas_v2.h>^~~~~~~~~~~~~1 error generated.

Solution:
Set Makefile.config Uncomment cpu_only: = 1 comments in front of

Question two:

./INCLUDE/CAFFE/UTIL/MKL_ALTERNATE.HPP::'cblas.h'file   <cblas.h>

Solution:
1th Step: Brew Install Homebrew/science/openblas
2nd Step:
Modify the Makefile.config file in blas:= atlas to Blas: = Openblas
Modify the Blas library or header file in the Makefile.config file:
Blas_include: =/usr/local/opt/openblas/include
Blas_lib: =/usr/local/opt/openblas/lib

Question three:

No Receipt for 'Com.apple.pkg.CLTools_Executables'Found at'/'./bin/SH: Line0: [: -gt:unary operator Expected/bin/SH: Line0: [: -gt:unary operator EXPECTEDLD-O. build_release/lib/libcaffe.so.1.0.0Clang:warning:argument unused during compilation:'-pthread'[-wunused-command-line-argument]LD: Framework not found VecLibclang:error:linker command failed with exit code1(Use-v to see invocation) Make: * * * [. build_release/lib/libcaffe.so.1.0.0] Error1

Solution:
On the command line, enter: Xcode-select--install

Step three, compile Pycaffe
 make Pycaffe

Question one:

Cxx/ld-o python/caffe/_caffe.so Python/caffe/_caffe. CPP python/caffe/_caffe. cpp:'numpy/arrayobject.h'file< numpy/arrayobject.h>^~~~~~~~~~~~~~~~~~~~~1  error generated.  Make 1

Solution:
1th Step: Brew Install NumPy
2nd Step:

Modify Makefile.config

Remove comments

# Python_include + = $ (dir'import numpy.core; print (numpy.core.__file__)))/  + = $ (Shell brew--prefix numpy)/lib

Into

Python_include + = $ (dir'import numpy.core; print (numpy.core.__file__)))/  + = $ (Shell brew--prefix numpy)/lib

Question two:

LD  for-1 (use-v to see invocation)make1

Solution:
Brew Install Boost-python

To install Caffe Python dependencies:
CD python
For req in $ (cat requirements.txt); Do pip install--user $req; Done

Deep Learning Framework Caffe installation process on MacOS Heigh Sierra

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.