Openpose终于发布了手部关键点检测,喜大普奔!!
在重新编译的时候遇到了跟第一次编译一样的问题,但是原来怎么解决的想不起来了。又折腾了十多分钟很久才搞定。这里记录一下。
遇到的问题是在编译caffe时,make all -j4
成功,make distribution -j4
报错:
shengchun@wangsc-asus:~/openpose/3rdparty/caffe$ make distribute -j4
touch python/caffe/proto/__init__.py
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
PROTOC (python) src/caffe/proto/caffe.proto
python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: 没有那个文件或目录
compilation terminated.
Makefile:512: recipe for target ‘python/caffe/_caffe.so’ failed
make: * [python/caffe/_caffe.so] Error 1
Makefile.config里arrayobject.h的文件路径是:
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
用locate
命令找出arrayobject.h在系统里的真实路径。
shengchun@wangsc-asus:~$ locate arrayobject.h
/usr/include/python2.7/bytearrayobject.h
/usr/include/python3.5m/bytearrayobject.h
/usr/include/x86_64-linux-gnu/qt5/QtGui/qopenglvertexarrayobject.h
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h
/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/ndarrayobject.h
/usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/arrayobject.h
/usr/local/lib/python3.5/dist-packages/numpy/core/include/numpy/ndarrayobject.h
编辑Makefile.config文件,改成正确的文件路径,再编译distribution就顺利完成了。
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/local/lib/python2.7/dist-packages/numpy/core/include
编译完成后,执行demo
,可进入openpose
目录,命令行执行./build/examples/openpose/openpose.bin
。如果直接进入/build/examples/openpose/,执行./openpose.bin会报错。