openpose编译告诉libopenpose.so:未定义引用`op :: renderPartAffinityFieldGpu(... t)'

时间:2017-05-29 22:17:22

标签: caffe opencv3.0

我的配置是:

Openpose:latest(2017-05-29) master branch
Caffe   :latest(2017-05-29) master branch
OpenCV  :3.1
Ubuntu  16.04 64bit
GCC     :5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

我想在我的笔记本电脑上使用AMD显卡试用openpose,所以我禁用了CUDA,并在caffe Makefile.config中启用了opencv 3,如下所示:

CPU_ONLY := 1
OPENCV_VERSION := 3

编译后的caffe,

cp openpose/3rdparty/caffe/Makefile.config openpose/

然后

make all -j 10

得到了这些:

CXX/LD -o .build_release/examples/tutorial_thread/1_openpose_read_and_display.bin
CXX/LD -o .build_release/examples/tutorial_thread/3_user_input_processing_and_output.bin
.build_release/lib/libopenpose.so: undefined references to `op::renderPartAffinityFieldGpu(float*, op::PoseModel, cv::Size_<int> const&, float const*, cv::Size_<int> const&, float, int, float)'
.build_release/lib/libopenpose.so: undefined references to `op::renderBodyPartsGpu(float*, op::PoseModel, cv::Size_<int> const&, float const*, cv::Size_<int> const&, float, float)'
.build_release/lib/libopenpose.so: undefined references to `void op::connectBodyPartsGpu<float>(op::Array<float>&, float*, float const*, float const*, op::PoseModel, cv::Size_<int> const&, int, int, float, int, float, float)'
.build_release/lib/libopenpose.so: undefined references to `void op::connectBodyPartsGpu<double>(op::Array<double>&, double*, double const*, double const*, op::PoseModel, cv::Size_<int> const&, int, int, double, int, double, double)'
.build_release/lib/libopenpose.so: undefined references to `op::renderBodyPartGpu(float*, op::PoseModel, cv::Size_<int> const&, float const*, cv::Size_<int> const&, float, int, float)'
.build_release/lib/libopenpose.so: undefined references to `cudaGetErrorString'
.build_release/lib/libopenpose.so: undefined references to `cudaFree'
.build_release/lib/libopenpose.so: undefined references to `void op::resizeAndMergeGpu<double>(double*, double const*, std::array<int, 4ul> const&, std::array<int, 4ul> const&, double)'
.build_release/lib/libopenpose.so: undefined references to `cudaPeekAtLastError'
.build_release/lib/libopenpose.so: undefined references to `op::renderHandsGpu(float*, cv::Size_<int> const&, float const*, int, float)'
.build_release/lib/libopenpose.so: undefined references to `void op::nmsGpu<float>(float*, int*, float const*, float, std::array<int, 4ul> const&, std::array<int, 4ul> const&)'
.build_release/lib/libopenpose.so: undefined references to `cudaMalloc'
.build_release/lib/libopenpose.so: undefined references to `cudaMemcpy'
.build_release/lib/libopenpose.so: undefined references to `void op::resizeAndMergeGpu<float>(float*, float const*, std::array<int, 4ul> const&, std::array<int, 4ul> const&, float)'
.build_release/lib/libopenpose.so: undefined references to `op::renderFaceGpu(float*, cv::Size_<int> const&, float const*, int, float)'
.build_release/lib/libopenpose.so: undefined references to `void op::nmsGpu<double>(double*, int*, double const*, double, std::array<int, 4ul> const&, std::array<int, 4ul> const&)'
.build_release/lib/libopenpose.so: undefined references to `op::renderPoseGpu(float*, op::PoseModel, int, cv::Size_<int> const&, float const*, bool, bool, float)'
.build_release/lib/libopenpose.so: undefined references to `op::renderPartAffinityFieldsGpu(float*, op::PoseModel, cv::Size_<int> const&, float const*, cv::Size_<int> const&, float, float)'
collect2: error: ld returned 1 exit status
Makefile:492: die Regel für Ziel „.build_release/examples/tutorial_thread/3_user_input_processing_and_output.bin“ scheiterte
make: *** [.build_release/examples/tutorial_thread/3_user_input_processing_and_output.bin] Fehler 1
make: *** Auf noch nicht beendete Prozesse wird gewartet …

似乎示例代码仍然使用cuda / gpu相关的东西,是吗?如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

很抱歉,你不能为OpenPose禁用GPU(也不是OpenPose会使用的Caffe)。

OpenPose的CPU代码没有完成(考虑到速度很慢,预计不会完成)。您将不得不使用CUDA + cuDNN。因此,一台配有NVIDIA显卡的机器。