Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Build error with Opencv with Inference Engine backend on raspberry

I install OpenCV 4.0.1 followed Raspbian Stretch: Install OpenCV 3 + Python on your Raspberry Pi , successfully compiled and installed on my raspberry. But when I want compiled Opencv with Inference Engine backend, got some error.

my env:

  • Raspberry 3b+
  • OS: Raspbian 9.8
  • Python: 3.5.3
  • GCC: 6.3.0
  • Make: 4.1
  • Cmake: 3.7.2

Here is my code:

install dependencies(python’s dep already done):

bash sudo apt-get install \ cmake pkg-config \ libjpeg-dev libtiff5-dev libjasper-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ libxvidcore-dev libx264-dev \ libgtk2.0-dev libgtk-3-dev \ libatlas-base-dev gfortran \ build-essential \ xz-utils \ libgtk2.0-dev:armhf \ libgstreamer1.0-dev:armhf \ libgstreamer-plugins-base1.0-dev:armhf

cmake param:

bash cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="../opencv_install" \ -DOPENCV_CONFIG_INSTALL_PATH="cmake" \ -DWITH_IPP=OFF \ -DBUILD_TESTS=OFF \ -DBUILD_PERF_TESTS=OFF \ -DPYTHON3_EXECUTABLE=/usr/bin/python3.5 \ -DPYTHON3_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \ -DPYTHON3_INCLUDE_DIR=/usr/include/python3.5m \ -DPYTHON3_INCLUDE_DIR2=/usr/include/arm-linux-gnueabihf/python3.5m \ -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.5/dist-packages/numpy/core/include \ -DPYTHON3_CVPY_SUFFIX=".cpython-35m-arm-linux-gnueabihf.so" \ -DENABLE_NEON=ON \ -DCPU_BASELINE="NEON" \ -DWITH_INF_ENGINE=ON \ -DINF_ENGINE_LIB_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/lib/raspbian_9/armv7l" \ -DINF_ENGINE_INCLUDE_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include" \ -DCMAKE_FIND_ROOT_PATH="/home/pi/inference_engine_vpu_arm/" \ -DENABLE_CXX11=ON ..

then make -j4, come out a error:

```bash [ 62%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/dnn.cpp.o cd /home/pi/opencv/opencv_build/modules/dnn && /usr/bin/c++ -DCVAPI_EXPORTS -DCV_OCL4DNN=1 -DHAVE_INF_ENGINE=1 -DHAVE_PROTOBUF=1 -DINF_ENGINE_RELEASE=2019010000 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/pi/opencv/opencv_build -I/home/pi/opencv/modules/dnn/src -I/home/pi/opencv/modules/dnn/include -I/home/pi/opencv/opencv_build/modules/dnn -I/home/pi/opencv/modules/core/include -I/home/pi/opencv/modules/imgproc/include -I/home/pi/opencv/modules/dnn/misc/caffe -I/home/pi/opencv/modules/dnn/misc/tensorflow -I/home/pi/opencv/modules/dnn/misc/onnx -I/home/pi/opencv/3rdparty/include/opencl/1.2 -isystem /home/pi/opencv/3rdparty/protobuf/src -isystem /home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated -Wno-missing-declarations -Wno-shadow -Wno-unused-parameter -Wno-sign-compare -Wno-invalid-offsetof -O3 -DNDEBUG -DNDEBUG -fPIC -std=c++11 -Winvalid-pch -include "/home/pi/opencv/opencv_build/modules/dnn/precomp.hpp" -o CMakeFiles/opencv_dnn.dir/src/dnn.cpp.o -c /home/pi/opencv/modules/dnn/src/dnn.cpp

/home/pi/opencv/modules/dnn/src/dnn.cpp: In member function ‘void cv::dnn::dnn4_v20190122::Net::Impl::initInfEngineBackend()’: /home/pi/opencv/modules/dnn/src/dnn.cpp:1708:68: error: ‘class InferenceEngine::Paramete ’ has no member named ‘as’ InferenceEngine::Blob::Ptr bp = it->second.as<inferenceengine::blob::ptr>(); ^~ /home/pi/opencv/modules/dnn/src/dnn.cpp:1708:97: error: expected primary-expression before ‘>’ token InferenceEngine::Blob::Ptr bp = it->second.as<inferenceengine::blob::ptr>(); ^ /home/pi/opencv/modules/dnn/src/dnn.cpp:1708:99: error: expected primary-expression before ‘)’ token InferenceEngine::Blob::Ptr bp = it->second.as<inferenceengine::blob::ptr>();

...

/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include/ie_parameter.hpp:42:71: error: no matching function for call to ‘to_string(const std::shared_ptr<inferenceengine::blob>&)’ Parameter(const T& value): initialized(true), value(std::to_string(value)) {} // NOLINT ~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/6/string:52:0, from /usr/include/c++/6/stdexcept:39, from /usr/include/c++/6/array:39, from /home/pi/opencv/modules/core/include/opencv2/core/cvdef.h:671, from /home/pi/opencv/modules/core/include/opencv2/core.hpp:52, from /home/pi/opencv/opencv_build/modules/dnn/precomp.hpp:42: /usr/include/c++/6/bits/basic_string.h:5470:3: note: candidate: std::__cxx11::string std::__cxx11::to_string(int) to_string(int __val) ^~~~~~~~~ /usr/include/c++/6/bits/basic_string.h:5470:3: note: no known conversion for argument 1 from ‘const std::shared_ptr<inferenceengine::blob>’ to ‘int’ /usr/include/c++/6/bits/basic_string.h:5475:3: note: candidate: std::__cxx11::string std::__cxx11::to_string(unsigned int) to_string(unsigned __val) ^~~~~~~~~ ...
```

Please help me figure it out, appreciate for your reply.

click to hide/show revision 2
None

updated 2019-04-08 03:02:59 -0600

berak gravatar image

Build error with Opencv with Inference Engine backend on raspberry

I install OpenCV 4.0.1 followed Raspbian Stretch: Install OpenCV 3 + Python on your Raspberry Pi , successfully compiled and installed on my raspberry. But when I want compiled Opencv with Inference Engine backend, got some error.

my env:

  • - Raspberry 3b+
  • 3b+ - OS: Raspbian 9.8
  • 9.8 - Python: 3.5.3
  • 3.5.3 - GCC: 6.3.0
  • 6.3.0 - Make: 4.1
  • 4.1 - Cmake: 3.7.2
3.7.2

Here is my code:

install dependencies(python’s dep already done):

bash

bash
sudo apt-get install \  
    cmake pkg-config \  
    libjpeg-dev libtiff5-dev libjasper-dev \  
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \  
    libxvidcore-dev libx264-dev \  
    libgtk2.0-dev libgtk-3-dev \  
    libatlas-base-dev gfortran \  
    build-essential \  
    xz-utils \  
    libgtk2.0-dev:armhf \  
    libgstreamer1.0-dev:armhf \  
    libgstreamer-plugins-base1.0-dev:armhf  
libgstreamer-plugins-base1.0-dev:armhf

cmake param:

bash

bash
cmake -DCMAKE_BUILD_TYPE=Release \  
      -DCMAKE_INSTALL_PREFIX="../opencv_install" \  
      -DOPENCV_CONFIG_INSTALL_PATH="cmake" \  
      -DWITH_IPP=OFF \  
      -DBUILD_TESTS=OFF \  
      -DBUILD_PERF_TESTS=OFF \  
      -DPYTHON3_EXECUTABLE=/usr/bin/python3.5 \  
      -DPYTHON3_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \  
      -DPYTHON3_INCLUDE_DIR=/usr/include/python3.5m \  
      -DPYTHON3_INCLUDE_DIR2=/usr/include/arm-linux-gnueabihf/python3.5m \  
      -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.5/dist-packages/numpy/core/include \  
      -DPYTHON3_CVPY_SUFFIX=".cpython-35m-arm-linux-gnueabihf.so" \  
      -DENABLE_NEON=ON \  
      -DCPU_BASELINE="NEON" \  
      -DWITH_INF_ENGINE=ON \  
      -DINF_ENGINE_LIB_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/lib/raspbian_9/armv7l" \  
      -DINF_ENGINE_INCLUDE_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include" \  
      -DCMAKE_FIND_ROOT_PATH="/home/pi/inference_engine_vpu_arm/" \  
      -DENABLE_CXX11=ON ..  
..

then make -j4, come out a error:

```bash bash

[ 62%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/dnn.cpp.o
cd /home/pi/opencv/opencv_build/modules/dnn && /usr/bin/c++   -DCVAPI_EXPORTS -DCV_OCL4DNN=1 -DHAVE_INF_ENGINE=1 -DHAVE_PROTOBUF=1 -DINF_ENGINE_RELEASE=2019010000 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/pi/opencv/opencv_build -I/home/pi/opencv/modules/dnn/src -I/home/pi/opencv/modules/dnn/include -I/home/pi/opencv/opencv_build/modules/dnn -I/home/pi/opencv/modules/core/include -I/home/pi/opencv/modules/imgproc/include -I/home/pi/opencv/modules/dnn/misc/caffe -I/home/pi/opencv/modules/dnn/misc/tensorflow -I/home/pi/opencv/modules/dnn/misc/onnx -I/home/pi/opencv/3rdparty/include/opencl/1.2 -isystem /home/pi/opencv/3rdparty/protobuf/src -isystem /home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include  -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated -Wno-missing-declarations -Wno-shadow -Wno-unused-parameter -Wno-sign-compare -Wno-invalid-offsetof -O3 -DNDEBUG  -DNDEBUG -fPIC   -std=c++11  -Winvalid-pch  -include "/home/pi/opencv/opencv_build/modules/dnn/precomp.hpp" -o CMakeFiles/opencv_dnn.dir/src/dnn.cpp.o -c /home/pi/opencv/modules/dnn/src/dnn.cpp

/home/pi/opencv/modules/dnn/src/dnn.cpp /home/pi/opencv/modules/dnn/src/dnn.cpp: In member function ‘void cv::dnn::dnn4_v20190122::Net::Impl::initInfEngineBackend()’: /home/pi/opencv/modules/dnn/src/dnn.cpp:1708:68: error: ‘class InferenceEngine::Paramete ’ has no member named ‘as’ InferenceEngine::Blob::Ptr bp = it->second.as<inferenceengine::blob::ptr>(); it->second.as<InferenceEngine::Blob::Ptr>(); ^~ /home/pi/opencv/modules/dnn/src/dnn.cpp:1708:97: error: expected primary-expression before ‘>’ token InferenceEngine::Blob::Ptr bp = it->second.as<inferenceengine::blob::ptr>(); it->second.as<InferenceEngine::Blob::Ptr>(); ^ /home/pi/opencv/modules/dnn/src/dnn.cpp:1708:99: error: expected primary-expression before ‘)’ token InferenceEngine::Blob::Ptr bp = it->second.as<inferenceengine::blob::ptr>();

it->second.as<InferenceEngine::Blob::Ptr>();

...

/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include/ie_parameter.hpp:42:71: error: no matching function for call to ‘to_string(const std::shared_ptr<inferenceengine::blob>&)’
std::shared_ptr<InferenceEngine::Blob>&)’
     Parameter(const T& value): initialized(true), value(std::to_string(value)) {}   // NOLINT
                                                         ~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/stdexcept:39,
                 from /usr/include/c++/6/array:39,
                 from /home/pi/opencv/modules/core/include/opencv2/core/cvdef.h:671,
                 from /home/pi/opencv/modules/core/include/opencv2/core.hpp:52,
                 from /home/pi/opencv/opencv_build/modules/dnn/precomp.hpp:42:
/usr/include/c++/6/bits/basic_string.h:5470:3: note: candidate: std::__cxx11::string std::__cxx11::to_string(int)
   to_string(int __val)
   ^~~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5470:3: note:   no known conversion for argument 1 from ‘const std::shared_ptr<inferenceengine::blob>’ std::shared_ptr<InferenceEngine::Blob>’ to ‘int’
/usr/include/c++/6/bits/basic_string.h:5475:3: note: candidate: std::__cxx11::string std::__cxx11::to_string(unsigned int)
   to_string(unsigned __val)
   ^~~~~~~~~
... 
```

...

Please help me figure it out, appreciate for your reply.

click to hide/show revision 3
retagged

updated 2019-04-08 03:03:18 -0600

berak gravatar image

Build error with Opencv with Inference Engine backend on raspberry

I install OpenCV 4.0.1 followed Raspbian Stretch: Install OpenCV 3 + Python on your Raspberry Pi , successfully compiled and installed on my raspberry. But when I want compiled Opencv with Inference Engine backend, got some error.

my env:

- Raspberry 3b+
- OS: Raspbian 9.8
- Python: 3.5.3
- GCC: 6.3.0
- Make: 4.1
- Cmake: 3.7.2

Here is my code:

install dependencies(python’s dep already done):

bash

sudo apt-get install \  
    cmake pkg-config \  
    libjpeg-dev libtiff5-dev libjasper-dev \  
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \  
    libxvidcore-dev libx264-dev \  
    libgtk2.0-dev libgtk-3-dev \  
    libatlas-base-dev gfortran \  
    build-essential \  
    xz-utils \  
    libgtk2.0-dev:armhf \  
    libgstreamer1.0-dev:armhf \  
    libgstreamer-plugins-base1.0-dev:armhf

cmake param:

bash

cmake -DCMAKE_BUILD_TYPE=Release \  
      -DCMAKE_INSTALL_PREFIX="../opencv_install" \  
      -DOPENCV_CONFIG_INSTALL_PATH="cmake" \  
      -DWITH_IPP=OFF \  
      -DBUILD_TESTS=OFF \  
      -DBUILD_PERF_TESTS=OFF \  
      -DPYTHON3_EXECUTABLE=/usr/bin/python3.5 \  
      -DPYTHON3_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \  
      -DPYTHON3_INCLUDE_DIR=/usr/include/python3.5m \  
      -DPYTHON3_INCLUDE_DIR2=/usr/include/arm-linux-gnueabihf/python3.5m \  
      -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/local/lib/python3.5/dist-packages/numpy/core/include \  
      -DPYTHON3_CVPY_SUFFIX=".cpython-35m-arm-linux-gnueabihf.so" \  
      -DENABLE_NEON=ON \  
      -DCPU_BASELINE="NEON" \  
      -DWITH_INF_ENGINE=ON \  
      -DINF_ENGINE_LIB_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/lib/raspbian_9/armv7l" \  
      -DINF_ENGINE_INCLUDE_DIRS="/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include" \  
      -DCMAKE_FIND_ROOT_PATH="/home/pi/inference_engine_vpu_arm/" \  
      -DENABLE_CXX11=ON ..

then make -j4, come out a error:

bash

[ 62%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/dnn.cpp.o
cd /home/pi/opencv/opencv_build/modules/dnn && /usr/bin/c++   -DCVAPI_EXPORTS -DCV_OCL4DNN=1 -DHAVE_INF_ENGINE=1 -DHAVE_PROTOBUF=1 -DINF_ENGINE_RELEASE=2019010000 -D_USE_MATH_DEFINES -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/pi/opencv/opencv_build -I/home/pi/opencv/modules/dnn/src -I/home/pi/opencv/modules/dnn/include -I/home/pi/opencv/opencv_build/modules/dnn -I/home/pi/opencv/modules/core/include -I/home/pi/opencv/modules/imgproc/include -I/home/pi/opencv/modules/dnn/misc/caffe -I/home/pi/opencv/modules/dnn/misc/tensorflow -I/home/pi/opencv/modules/dnn/misc/onnx -I/home/pi/opencv/3rdparty/include/opencl/1.2 -isystem /home/pi/opencv/3rdparty/protobuf/src -isystem /home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include  -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wundef -Winit-self -Wpointer-arith -Wsign-promo -Wuninitialized -Winit-self -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -mfpu=neon -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -Wno-deprecated -Wno-missing-declarations -Wno-shadow -Wno-unused-parameter -Wno-sign-compare -Wno-invalid-offsetof -O3 -DNDEBUG  -DNDEBUG -fPIC   -std=c++11  -Winvalid-pch  -include "/home/pi/opencv/opencv_build/modules/dnn/precomp.hpp" -o CMakeFiles/opencv_dnn.dir/src/dnn.cpp.o -c /home/pi/opencv/modules/dnn/src/dnn.cpp

/home/pi/opencv/modules/dnn/src/dnn.cpp: In member function ‘void cv::dnn::dnn4_v20190122::Net::Impl::initInfEngineBackend()’:
/home/pi/opencv/modules/dnn/src/dnn.cpp:1708:68: error: ‘class InferenceEngine::Paramete
’ has no member named ‘as’
                         InferenceEngine::Blob::Ptr bp = it->second.as<InferenceEngine::Blob::Ptr>();
                                                                    ^~
/home/pi/opencv/modules/dnn/src/dnn.cpp:1708:97: error: expected primary-expression before ‘>’ token
             InferenceEngine::Blob::Ptr bp = it->second.as<InferenceEngine::Blob::Ptr>();
                                                                                     ^
/home/pi/opencv/modules/dnn/src/dnn.cpp:1708:99: error: expected primary-expression before ‘)’ token
             InferenceEngine::Blob::Ptr bp = it->second.as<InferenceEngine::Blob::Ptr>();

...

/home/pi/inference_engine_vpu_arm/deployment_tools/inference_engine/include/ie_parameter.hpp:42:71: error: no matching function for call to ‘to_string(const std::shared_ptr<InferenceEngine::Blob>&)’
     Parameter(const T& value): initialized(true), value(std::to_string(value)) {}   // NOLINT
                                                         ~~~~~~~~~~~~~~^~~~~~~
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/stdexcept:39,
                 from /usr/include/c++/6/array:39,
                 from /home/pi/opencv/modules/core/include/opencv2/core/cvdef.h:671,
                 from /home/pi/opencv/modules/core/include/opencv2/core.hpp:52,
                 from /home/pi/opencv/opencv_build/modules/dnn/precomp.hpp:42:
/usr/include/c++/6/bits/basic_string.h:5470:3: note: candidate: std::__cxx11::string std::__cxx11::to_string(int)
   to_string(int __val)
   ^~~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5470:3: note:   no known conversion for argument 1 from ‘const std::shared_ptr<InferenceEngine::Blob>’ to ‘int’
/usr/include/c++/6/bits/basic_string.h:5475:3: note: candidate: std::__cxx11::string std::__cxx11::to_string(unsigned int)
   to_string(unsigned __val)
   ^~~~~~~~~
...

Please help me figure it out, appreciate for your reply.