Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6401 Discussions

dnn net.forward() -- munmap_chunk(): invalid pointer

PJIA01
Beginner
1,328 Views

I'm playing OpenVINO on Raspberry Pi 4, following this manual:

https://docs.openvinotoolkit.org/latest/_docs_install_guides_installing_openvino_raspbian.html

but obtain the following ERROR

munmap_chunk(): invalid pointer Aborted

at line out = net.forward()

 

I posted my question on OpenCV's issue https://github.com/opencv/opencv/issues/16379 , can anybody give me a hand??

 

BTW, I built OpenCV on rpi4 with OpenVINO inference engine ...

 

Cheers

Pei

 

 

 

 

 

0 Kudos
6 Replies
RandallMan_B_Intel
1,328 Views

Hi Pei,

 

Thanks for reaching out.

Which version of Python are you using? I would recommend using Python* 3.5, 32-bit, as the install guide requires.

Regarding the Github case, review the absolute path in the input. Would it be possible to share your files and commands that you are using to test it from our end? We have tested using all steps on the guide the openvino_fd_myriad.py and seems to work fine.

 

Regards, 

Randall.

0 Kudos
PJIA01
Beginner
1,328 Views

Hi, Randall:

 

I'm using the default python from repo of the NEWEST Raspbian 2019-09-26.

pi@raspberrypi:~ $ python --version
Python 3.7.3

 

As for the [OpenVINO for Raspbian](https://docs.openvinotoolkit.org/latest/_docs_install_guides_installing_openvino_raspbian.html#set-environment-variables) , I can successfully run ALL other parts, except the final example openvino_fd_myriad.py .

In order to run it successfully, I've got to even modify the file cmake/OpenCVDetectInferenceEngine.cmake

set(_loc "$ENV{INTEL_OPENVINO_DIR}")
if(NOT _loc AND DEFINED ENV{INTEL_CVSDK_DIR})
  set(_loc "$ENV{INTEL_CVSDK_DIR}")  # OpenVINO 2018.x
endif()
if(NOT INF_ENGINE_TARGET AND _loc)
    #  if(NOT INF_ENGINE_RELEASE VERSION_GREATER "2018050000")
    #    set(INF_ENGINE_PLATFORM_DEFAULT "ubuntu_16.04")
    #  else()
    #    set(INF_ENGINE_PLATFORM_DEFAULT "")
    #  endif()
  set(INF_ENGINE_PLATFORM "${INF_ENGINE_PLATFORM_DEFAULT}" CACHE STRING "InferenceEngine platform (library dir)")
  find_path(ie_custom_env_inc "inference_engine.hpp" PATHS "${_loc}/deployment_tools/inference_engine/include" NO_DEFAULT_PATH)
  find_library(ie_custom_env_lib "inference_engine" PATHS "${_loc}/deployment_tools/inference_engine/lib/armv7l" NO_DEFAULT_PATH)
  find_library(ie_custom_env_lib_rel "inference_engine" PATHS "${_loc}/deployment_tools/inference_engine/lib/armv7l/Release" NO_DEFAULT_PATH)
  find_library(ie_custom_env_lib_dbg "inference_engine" PATHS "${_loc}/deployment_tools/inference_engine/lib/armv7l/Debug" NO_DEFAULT_PATH)
  add_custom_ie_build("${ie_custom_env_inc}" "${ie_custom_env_lib}" "${ie_custom_env_lib_rel}" "${ie_custom_env_lib_dbg}" "OpenVINO (${_loc})")
endif()

 

Can you try the NEWEST Raspbian with a NEWER Python? Thank you...

 

Pei

 

 

Randall B. (Intel) wrote:

Hi Pei,

 

Thanks for reaching out.

Which version of Python are you using? I would recommend using Python* 3.5, 32-bit, as the install guide requires.

Regarding the Github case, review the absolute path in the input. Would it be possible to share your files and commands that you are using to test it from our end? We have tested using all steps on the guide the openvino_fd_myriad.py and seems to work fine.

 

Regards, 

Randall.

0 Kudos
PJIA01
Beginner
1,328 Views

 

Hi, Randall:

I managed to have it run on my Laptop, which is of course intel64, and OpenCV 4.2.0 is built with CUDA, and python 3.8. But it seems the model (face-detection-adas-0001 loaded in openvino_fd_myriad.py) performance is NOT that good... 

I'm still testing on armv7l, OpenCV successfully built with OPENCV_DNN_OPENCL on, but failed to run openvino_fd_myriad.py with the following error message:

double free or corruption (out)
Aborted

 

100% sure it's this line: 

out = net.forward()

 

Please check my blog: https://longervision.github.io/2019/12/28/AI/EdgeComputing/raspberry-pi-4-movidius-nerual-compute-stick-2-openvino/

 

Pei

0 Kudos
RandallMan_B_Intel
1,328 Views

Hi, Pei,

 

We reproduce and tested from our end the issue and the error was solved following the next steps on this guide. We used the following versions:

  • Raspberry Pi 4 with Raspbian 2019-09-26
  • OpenVINO 2019.3.334
  • Python 3.7.3
  • OpenCV 4.1.0

Please, run the openvino_fd_myriad.py again and let me know if you have additional questions.

 

Regards, 

Randall.

0 Kudos
PJIA01
Beginner
1,329 Views

 

[ 90%] Building CXX object tools/vpu/vpu_compile/CMakeFiles/myriad_compile.dir/__/common/vpu_tools_common.cpp.o
cd ....../dldt/inference-engine/build/tools/vpu/vpu_compile && /usr/bin/c++  -DENABLE_MYRIAD=1 -DENABLE_PROFILING_RAW=1 -DENABLE_UNICODE_PATH_SUPPORT -DGFLAGS_IS_A_DLL=0 -DIE_BUILD_POSTFIX=\"\" -DIE_THREAD=IE_THREAD_SEQ -I....../dldt/inference-engine/src/vpu/graph_transformer/include -I....../dldt/inference-engine/src/vpu/common/include -I....../dldt/inference-engine/build/samples/thirdparty/gflags/include -isystem ....../dldt/inference-engine/samples/common -isystem ....../dldt/inference-engine/include -isystem ....../dldt/inference-engine/tools/vpu/common -isystem ....../dldt/inference-engine/src/inference_engine -isystem ....../dldt/inference-engine/thirdparty/pugixml/src -isystem ....../dldt/inference-engine/thirdparty/movidius/mvnc/include  -std=c++11 -march=armv7-a -Werror -Werror=return-type  -Wuninitialized -Winit-self -Wmaybe-uninitialized -fvisibility-inlines-hidden -ffunction-sections -fdata-sections  -fPIE -fPIC -Wformat -Wformat-security -fstack-protector-strong -O3 -DNDEBUG -D_FORTIFY_SOURCE=2 -s -fvisibility=hidden -fPIE   -Werror -Wall -std=gnu++11 -o CMakeFiles/myriad_compile.dir/__/common/vpu_tools_common.cpp.o -c ....../dldt/inference-engine/tools/vpu/common/vpu_tools_common.cpp
/usr/bin/ld: warning: libopencv_videoio.so.4.1, needed by ../../../../bin/armv7l/Release/lib/libformat_reader.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgcodecs.so.4.1, needed by ../../../../bin/armv7l/Release/lib/libformat_reader.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc.so.4.1, needed by ../../../../bin/armv7l/Release/lib/libformat_reader.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_core.so.4.1, needed by ../../../../bin/armv7l/Release/lib/libformat_reader.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute_iterator::operator*() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_document::save_file(char const*, char const*, unsigned int, pugi::xml_encoding) const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libformat_reader.so: undefined reference to `cv::fastFree(void*)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::set_value(int)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_parse_result::description() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_named_node_iterator::operator++()'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::attributes_end() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_text::set(unsigned int)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute_iterator::operator!=(pugi::xml_attribute_iterator const&) const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::as_string(char const*) const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::operator!() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_document::load_buffer(void const*, unsigned int, unsigned int, pugi::xml_encoding)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_named_node_iterator::operator*() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::empty() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_text::get() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_document::xml_document()'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::append_attribute(char const*)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::attribute(char const*) const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::operator void (*)(pugi::xml_attribute***)() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_text::set(char const*)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::set_value(float)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::name() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_named_node_iterator::operator!=(pugi::xml_named_node_iterator const&) const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libformat_reader.so: undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::operator void (*)(pugi::xml_node***)() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libformat_reader.so: undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_document::load_file(char const*, unsigned int, pugi::xml_encoding)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::attributes_begin() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute_iterator::operator++()'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::next_sibling() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::value() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::child(char const*) const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::first_child() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_document::~xml_document()'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::children(char const*) const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::xml_node()'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::child_value() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::name() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::set_value(char const*)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::append_child(char const*)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::offset_debug() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_document::document_element() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::text() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::empty() const'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_attribute::set_value(unsigned int)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libformat_reader.so: undefined reference to `cv::Mat::copySize(cv::Mat const&)'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libformat_reader.so: undefined reference to `cv::Mat::deallocate()'
/usr/bin/ld: ../../../../bin/armv7l/Release/lib/libinference_engine.so: undefined reference to `pugi::xml_node::next_sibling(char const*) const'
collect2: error: ld returned 1 exit status
make[2]: *** [tools/vpu/vpu_profile/CMakeFiles/vpu_profile.dir/build.make:108: ../bin/armv7l/Release/vpu_profile] Error 1
make[2]: Leaving directory '....../dldt/inference-engine/build'
make[1]: *** [CMakeFiles/Makefile2:1328: tools/vpu/vpu_profile/CMakeFiles/vpu_profile.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

 

 

0 Kudos
JesusE_Intel
Moderator
1,329 Views

Hi Pei,

Looks like you are using the open-sourced version of the OpenVINO Toolkit (dldt), we just published the latest release to GitHub. Could you try it and let us know if the issue is still present? 

Alternatively, you can use the OpenVINO toolkit pre-built package for Raspbian OS. This will help you get up and running much faster without the need to build from source. You can find the package and instructions here:

https://docs.openvinotoolkit.org/latest/_docs_install_guides_installing_openvino_raspbian.html

https://download.01.org/opencv/2020/openvinotoolkit/

Regards,

Jesus

0 Kudos
Reply