ubuntu16.04+opencv3+opencv_contrib3+caffe_cpu+openpose_cpu

1. fatal error: caffe/proto/caffe.pb.h: No such file or directory #include "caffe/proto/caffe.pb.h" 

You need to generate caffe.pb.h manually using protoc as follows.

# In the directory you installed Caffe to
protoc src/caffe/proto/caffe.proto --cpp_out=.
mkdir include/caffe/proto
mv src/caffe/proto/caffe.pb.h include/caffe/proto

 

2. fatal error: caffe/include/caffe/syncedmen.hpp: fatal error: mkl.h,  no such file or directory

To manually select the CPU Version, open CMake GUI mentioned above, and set the GPU_MODE flag to CPU_ONLYNOTE: Accuracy of the CPU version is ~1% higher than CUDA version, so the results will vary.

  • On Ubuntu, OpenPose will link against the Intel MKL version (Math Kernel Library) of Caffe. Alternatively, the user can choose his own Caffe version, by unselecting USE_MKL and selecting his own Caffe path.

 

3. 下载opencv和对应的opencv_contrib版本,解压,将opencv_contrib放到opencv目录下

(1)下载依赖包:

sudo apt-get install build-essential  
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev  
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev 

sudo apt-get install build-essential qt5-default ccache libv4l-dev libavresample-dev  libgphoto2-dev libopenblas-base libopenblas-dev doxygen  openjdk-8-jdk pylint libvtk6-dev

sudo apt-get install pkg-config

(2)进入opencv目录下:

mkdir build

cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.6/modules -D PYTHON_EXECUTABLE=/usr/bin/python3.5 -D BUILD_EXAMPLES=ON ..

make -j4

sudo make install

(3)配置opencv的环境变量

sudo gedit /etc/ld.so.conf.d/opencv.conf

文件中写入:/usr/local/lib

sudo ldconfig

vim ~/.bashrc

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

 

4. [libprotobuf ERROR google/protobuf/message_lite.cc:123] Can't parse message of type "caffe.NetParameter" because it is missing required fields: layer[0].clip_param.min, layer[0].clip_param.max 

自己安装的caffe与openpose中的caffe版本不同,使用openpose中自带的caffe版本

https://github.com/CMU-Perceptual-Computing-Lab/caffe

 

 

 

 

你可能感兴趣的:(ubuntu16.04+opencv3+opencv_contrib3+caffe_cpu+openpose_cpu)