Errors in openpose / caffe_custom involving OpenCV on Ubuntu 20
I get this error on Ubuntu 20:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┠─── Upgrade module deps/openpose/caffe_custom ... ────────────────────────────────────────────────────────┨
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Prepare module deps/openpose/caffe_custom ...
Run 'cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_COMPILER_LAUNCHER=""
-DCMAKE_CXX_COMPILER_LAUNCHER="" -DARMARX_BUILD_TESTS="ON" -DCMAKE_C_COMPILER="/usr/bin/gcc-6"
-DCMAKE_CXX_COMPILER="/usr/bin/g++-6" -DCUDA_HOST_COMPILER="/usr/bin/g++-6" -DCMAKE_INSTALL_PREFIX="install"
-DCUDA_TOOLKIT_ROOT_DIR="/home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6"
-DCUDA_SDK_ROOT_DIR="/home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6"
-DCUDNN_ROOT="/home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6"
-DCUDNN_INCLUDE="/home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6/include"
-DCUDNN_LIBRARY="/home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6/lib64/libcudnn.so"
-DCUDA_CUDA_LIBRARY="/home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6/lib64/stubs/libcuda.so"
-DCUDA_ARCH_NAME="Manual" -DCUDA_ARCH_BIN="35 37 50 52 53 60 61 62 70 72 75" -DUSE_LEVELDB="OFF"
-DBUILD_python="OFF" ..' in '/home/rkartmann/code/deps/openpose/caffe_custom/build' ...
────────────────────────────────────────────── Command output ──────────────────────────────────────────────
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Warning (dev) at cmake/Misc.cmake:32 (set):
implicitly converting 'BOOLEAN' to 'STRING' type.
Call Stack (most recent call first):
CMakeLists.txt:25 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found gflags (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)
-- Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)
-- Found PROTOBUF Compiler: /usr/bin/protoc
-- Found lmdb (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so)
-- CUDA detected: 10.1
-- Found cuDNN: ver. 7.6.5 found (include: /home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6/include, library: /home/rkartmann/code/deps/cuda/cuda-10.1-cudnn-7.6/lib64/libcudnn.so)
-- Added CUDA NVCC flags for: sm_35 sm_37 sm_50 sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 compute_50
-- OpenCV found (/usr/lib/x86_64-linux-gnu/cmake/opencv4)
-- Found Atlas (include: /usr/include/x86_64-linux-gnu library: /usr/lib/x86_64-linux-gnu/libatlas.so lapack: /usr/lib/x86_64-linux-gnu/liblapack.so
-- Python interface is disabled or not all required dependencies found. Building without it...
-- Detected Doxygen OUTPUT_DIRECTORY: ./doxygen/
--
-- ******************* Caffe Configuration Summary *******************
-- General:
-- Version : 1.0.0
-- Git : 1.0-150-g2d4bf549
-- System : Linux
-- C++ compiler : /usr/bin/g++-6
-- Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -std=c++11 -Wno-sign-compare -Wno-uninitialized
-- Debug CXX flags : -g -fPIC -Wall -std=c++11 -Wno-sign-compare -Wno-uninitialized
-- Build type : Release
--
-- BUILD_SHARED_LIBS : ON
-- BUILD_python : OFF
-- BUILD_matlab : OFF
-- BUILD_docs : ON
-- CPU_ONLY : OFF
-- USE_OPENCV : ON
-- USE_LEVELDB : OFF
-- USE_LMDB : ON
-- USE_NCCL : OFF
-- ALLOW_LMDB_NOLOCK : OFF
-- USE_HDF5 : ON
--
-- Dependencies:
-- BLAS : Yes (Atlas)
-- Boost : Yes (ver. 1.71)
-- glog : Yes
-- gflags : Yes
-- protobuf : Yes (ver. 3.6.1)
-- lmdb : Yes (ver. 0.9.24)
-- OpenCV : Yes (ver. 4.2.0)
-- CUDA : Yes (ver. 10.1)
--
-- NVIDIA CUDA:
-- Target GPU(s) : Manual
-- GPU arch(s) : sm_35 sm_37 sm_50 sm_52 sm_53 sm_60 sm_61 sm_62 sm_70 sm_72 sm_75 compute_50
-- cuDNN : Yes (ver. 7.6.5)
--
-- Documentaion:
-- Doxygen : /home/rkartmann/code/deps/doxygen/doxygen-1.8.17/doxygen-1.8.17/bin/doxygen (1.8.17)
-- config_file : /home/rkartmann/code/deps/openpose/caffe_custom/.Doxyfile
--
-- Install:
-- Install path : /home/rkartmann/code/deps/openpose/caffe_custom/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rkartmann/code/deps/openpose/caffe_custom/build
────────────────────────────────────────────────────────────────────────────────────────────────────────────
Build module deps/openpose/caffe_custom ...
Set env vars: CMAKE_BUILD_PARALLEL_LEVEL='8' ...
Run 'nice ionice -c 2 -n 7 cmake --build . --target all' in
'/home/rkartmann/code/deps/openpose/caffe_custom/build' ...
────────────────────────────────────────────── Command output ──────────────────────────────────────────────
Consolidate compiler generated dependencies of target caffeproto
[ 1%] Built target caffeproto
Consolidate compiler generated dependencies of target caffe
[ 1%] Building CXX object src/caffe/CMakeFiles/caffe.dir/layers/window_data_layer.cpp.o
[ 2%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/util/io.cpp: In function ‘cv::Mat caffe::ReadImageToCVMat(const string&, int, int, bool)’:
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/util/io.cpp:76:34: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
^~~~~~~~~~~~~~~~~~~
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/util/io.cpp:77:5: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
CV_LOAD_IMAGE_GRAYSCALE);
^~~~~~~~~~~~~~~~~~~~~~~
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/util/io.cpp: In function ‘cv::Mat caffe::DecodeDatumToCVMat(const caffe::Datum&, bool)’:
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/util/io.cpp:182:34: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
^~~~~~~~~~~~~~~~~~~
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/util/io.cpp:183:5: error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
CV_LOAD_IMAGE_GRAYSCALE);
^~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:32882: src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/layers/window_data_layer.cpp: In member function ‘virtual void caffe::WindowDataLayer<Dtype>::load_batch(caffe::Batch<Dtype>*)’:
/home/rkartmann/code/deps/openpose/caffe_custom/src/caffe/layers/window_data_layer.cpp:293:42: error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope
cv_img = cv::imread(image.first, CV_LOAD_IMAGE_COLOR);
^~~~~~~~~~~~~~~~~~~
make[2]: *** [src/caffe/CMakeFiles/caffe.dir/build.make:32602: src/caffe/CMakeFiles/caffe.dir/layers/window_data_layer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:378: src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
────────────────────────────────────────────────────────────────────────────────────────────────────────────
Restore env vars: (delete CMAKE_BUILD_PARALLEL_LEVEL) ...
Building deps/openpose/caffe_custom failed:
Running 'nice ionice -c 2 -n 7 cmake --build . --target all' failed with return code 2 in
'/home/rkartmann/code/deps/openpose/caffe_custom/build'.
Interesting is the line
-- OpenCV found (/usr/lib/x86_64-linux-gnu/cmake/opencv4)
On my Ubuntu 18 machine, this line says:
-- OpenCV found (/usr/share/OpenCV)