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