openpose 编译告诉 libopenpose.so:对 `op::renderPartAffinityFieldGpu(...t)' 的未定义引用
openpose compilation tells libopenpose.so: undefined references to `op::renderPartAffinityFieldGpu(...t)'
我的配置是:
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 相关的东西,是吗?如何解决这个问题?
抱歉,您不能为 OpenPose 禁用 GPU(也不能禁用 OpenPose 将使用的 Caffe)。
OpenPose的CPU代码没有写完(速度很慢,暂时估计写不完)。您将不得不使用 CUDA + cuDNN。因此,一台带有NVIDIA显卡的机器。
我的配置是:
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 相关的东西,是吗?如何解决这个问题?
抱歉,您不能为 OpenPose 禁用 GPU(也不能禁用 OpenPose 将使用的 Caffe)。
OpenPose的CPU代码没有写完(速度很慢,暂时估计写不完)。您将不得不使用 CUDA + cuDNN。因此,一台带有NVIDIA显卡的机器。