在mac上跑fast-rcnn的过程大致和rbg大神在github上写的过程差不多,就是有些配置文件需要注意一下
前提是你已经安装好caffe并配好python环境,不懂的可以参考上一篇博客
以下是配置过程和问题解决方案
1、克隆rbg大神的代码,一定要加--recursive哦
git clone --recursive https://github.com/rbgirshick/fast-rcnn.git2、进入lib目录下编译
cd $FRCN_ROOT/lib make
3、进入caffe-fast-cnn目录运行
cd $FRCN_ROOT/caffe-fast-rcnn
make -j8 && make pycaffe
4、下载模型
cd $FRCN_ROOT ./data/scripts/fetch_fast_rcnn_models.sh
如果本地下不下来的,可以从我的百度云下载 链接:https://pan.baidu.com/s/1kwtr-4McgoF89eVCbtFPNg 密码:9gme
5、运行demo
cd $FRCN_ROOT/tools
./demo.py --cpu --net caffenet
6、运行结果
遇到的问题:
1、在lib下make时遇到
fatal error: 'numpy/arrayobject.h' file not found #include "numpy/arrayobject.h"
我的numpy安装过了,且makefile.config中PYTHON_INCLUDE地址配置无误的情况下
进入python,执行
import numpynumpy.get_include()
会显示如下地址
/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy
再执行 cp -r /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy /usr/local/include 即可(虽然不知道为什么,反正我的程序好了。。。)
2、在caffe-fast-rcnn里面运行时出现各种问题,比如
ld: cannot link directly with /System/Library/Frameworks//vecLib.framework/vecLib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so] Error 1
ld: symbol(s) not found for architecture x86_64等
这些都是makefile.config的问题,,可以参考安装caffe时的配置
我是改了blas(安装openblas)
放开以下几行代码
以下是我的makefile.config