mac10.12本身自带了python2.7,可以使用系统自带的python
1:安装homebrew
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/intall)”
brew install -vd snappy leveldb gflags glog szip lmdb
brew tap homebrew/science
brew install hdf5 opencv
根据使用的python版本不同,可能会出现一些问题,作如下调整:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
解决如下:在makefile文件中找到LIBRARIES 在后面添加 opencv_imgcodecs
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5 opencv_imgcodecs
然后就只剩下warning了
接着编译:
make all
make runtest
make runtest -j8
4.安装pycaffe和头文件等distribution
make pycaffe
fatal error: 'numpy/arrayobject.h' file not found
解决:
pip install -r requirements.txt
sudo pip install -r requirements.txt
出现错误:
OSError: [Errno 1] Operation not permitted: '/tmp/pip-2og_1F-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/scipy-0.13.0b1-py2.7.egg-info'
解决:
pip list