这次安装的服务器中并没有安装过Anaconda,如果是安装过Anaconda的机器,可能存在Caffe中protobuf与Anaconda中的protobuf版本不一致,至于这个怎么解决,我也尝试好久并没有解决。
CUDA9.0 CUDNN7.0.5 OpenCV3.4.1 安装请参考:https://blog.csdn.net/caicaiatnbu/article/details/87260199
git clone --recursive https://github.com/CMU-Perceptual-Computing-Lab/openpose.git
Caffe这里使用自带版本,Caffe目录位于 /openpose/3rdparty/caffe.
Caffe的安装请参考:https://blog.csdn.net/caicaiatnbu/article/details/85090977
cp Makefile.config.example Makefile.config 替换为
安装cmake-gui:
sudo apt-get install cmake-gui
下载模型:
cd openpose/models
sh getModels.sh
打开cmake,然后生成build文件
cd openpose/
mkdir build
cmake-gui
本文安装的source code目录:/home/wdong/jian24/openpose
build the binaries: /home/wdong/jian24/openpose/build
选择后,然后点击Configure 和 Generate。会弹出一个界面,勾选第一个,点击Finsh。
之后使用search:caffe ,对BUILD_CAFFE 去去掉勾选,同时设置
Caffe_INCLUDE_DIRS: /home/wdong/jian24/openpose/3rdparty/caffe/include
Caffe_LIBS: /home/wdong/jian24/openpose/3rdparty/caffe/build/lib/libcaffe.so
如下图所示:然后再次点击Configure 和 Generate。
cd openpose/build
sudo make -j16
提示找不到caffe/proto/caffe.pb.h,导致编译失败。解决:
在openpose/3rdparty/caffe/目录下,终端操作:
cd openpose/3rdparty/caffe/
protoc src/caffe/proto/caffe.proto --cpp_out=.
mkdir include/caffe/proto
mv src/caffe/proto/caffe.pb.h include/caffe/proto/
VideoCapture (IP camera/video) could not be opened for path: ‘examples/media/’. If it is a video path, is the path correct?
Coming from:
-D:\openpose\openpose-master\src\openpose\producer\videoCaptureReader.cpp:op::VideoCaptureReader::VideoCaptureReader():37
-D:\openpose\openpose-master\src\openpose\producer\videoCaptureReader.cpp:op::VideoCaptureReader::VideoCaptureReader():41
-D:\openpose\openpose-master\src\openpose\utilities\flagsToOpenPose.cpp:op::flagsToProducer():211
-D:\openpose\openpose-master\examples\openpose\openpose.cpp:openPoseDemo():372
terminate called after throwing an instance of ‘std::runtime_error’
解决办法:
https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/41
(路径要写成examples/media/video.avi,我写成了examples/media/)
如果不是这个问题,可能是OpenCV的问题,需要重新安装opencv试试。
注意:video的路径要精确到examples/media/xxx.avi,picture的路径只要写到examples/media/
cd openpose/
./build/examples/openpose/openpose.bin --video examples/media/video.avi
使用USB 摄像头测试:
./build/examples/openpose/openpose.bin --face --hand