安装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
心得:多百度,多google。