os x 10.12 安装caffe

安装caffe遇到的一些问题总结,适合mac, anaconda2,用anaconda提前安装opencv。

参考 http://blog.csdn.net/taigw/article/details/50683289

http://blog.csdn.net/yinchuandong2/article/details/49030121


make all 遇到

clang:warning: argument unused duringcompilation:'-pthread'Undefined symbolsfor architecturex86_64:

系统默认用libc++,而编译时指定了libstdc++, 搜索makefile,把采用了libstdc++的都替代成libc++,277, 278行。

make test

make runtest遇到

dyld: Library not loaded: @rpath/libprotobuf.12.dylib

这个问题的原因是caffe没有成功连接到Anaconda安装的libprotobuf.12.dylib。见http://blog.csdn.net/taigw/article/details/71057119

解决办法如下: 

1, 用otool查看caffe的连接库,用install_name_tool 进行有效连接

otool -Lcaffe | grep rpath install_name_tool -change "@rpath/libhdf5_hl.10.dylib" "/Users/taigw/anaconda/lib/libhdf5_hl.10.dylib" caffe


测试caffe

1.下载mnist数据

2.数据准备

./examples/mnist/create_mnist.sh

遇到

dyld: Library not loaded: @rpath/libprotobuf.12.dylib 

Referenced from: /usr/local/Cellar/caffe/build/examples/mnist/convert_mnist_data.bin

Reason: image not found

原因是在build/examples/mnist下的convert_mnist_data.bin的libprotobuf没有正确连接,一般libhdf5, libhdf5_hl也会连带着没正确连接,到该目录下按上述方法连接。

install_name_tool -change"@rpath/libhdf5_hl.10.dylib""/Users/taigw/anaconda/lib/libhdf5_hl.10.dylib" convert_mnist_data.bin


3.训练模型,先把XX.prototxt中GPU改成CPU,得到test精度0.99以上就对了。

./examples/mnist/train_lenet.sh

心得:多百度,多google。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值