Mac OSX 10.13配置caffe

mac10.12本身自带了python2.7,可以使用系统自带的python

1:安装homebrew

终端中输入下面命令行即可
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/intall)”
具体步骤可查看Homebrew官网

2.安装依赖项
	brew install -vd snappy leveldb gflags glog szip lmdb
	brew tap homebrew/science
	brew install hdf5 opencv
根据使用的python版本不同,可能会出现一些问题,作如下调整:
  brew edit opencv
继续安装依赖项:
  pip install protobuf
中间出现好几个问题,解决如下(关过一次窗口错误记不下来,建议根据具体问题找解决办法)

pip -v

pip install six

sudo pip install six -user-u

3.下载caffe
    git clone https://github.com/BVLC/caffe
    cd caffe
    cp Makefile.config.example Makefile.config
修改Makefile.config,将 CPU_ONLY := 1的注释去掉
# CPU-only switch (uncomment to build without GPU support)
CPU_ONLY := 1
接着编译:

make all

出现error:

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















感谢http://blog.csdn.net/kamiwon/article/details/54574996

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值