Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rachel_r_Intel
Employee
360 Views

Run OpenVINO™ toolkit R4 sample occurred error

HiI refer to https://software.intel.com/en-us/neural-compute-stick/get-started to verify OpenVINO™ toolkit R4 with Intel® Neural Compute Stick 2. But run OpenVINO™ toolkit R4 sample occurred error:

./demo_squeezenet_download_convert_run.sh -d MYRIAD

./classification_sample: error while loading shared libraries: libopencv_core.so.3.4: cannot open shared object file: No such file or directory

what confuses me is that the version of opencv in OpenVINO R4 has been updated to v4.0, why is it caused by the failure to find opencv v3.4?

Thanks all!

0 Kudos
8 Replies
Hyodo__Katsuya
Innovator
360 Views

@ren, rachel Please try below. Perhaps the environment variables are not reflected. $ nano ~/.bashrc source /opt/intel/computer_vision_sdk/bin/setupvars.sh #--- Add to final line $ source ~/.bashrc If this does not work, please correct the environment variable.
rachel_r_Intel
Employee
360 Views

@Hyodo, Katsuya

Thank you for your reply.

I have sourced the environment variable. But it does not work.

Hyodo__Katsuya
Innovator
360 Views

@ren, rachel Please tell us the result of the command below. $ printenv
rachel_r_Intel
Employee
360 Views

@Hyodo, Katsuya

Maybe you mainly care about the value of PATH and LD_LIBRARY_PATH.

LD_LIBRARY_PATH=/opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib:/opt/intel/opencl:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/gna/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/omp/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/lib/ubuntu_16.04/intel64:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/model_optimizer/bin:/opt/intel_r4//computer_vision_sdk_2018.4.420/openvx/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib:/opt/intel/opencl:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/gna/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/omp/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/lib/ubuntu_16.04/intel64:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/model_optimizer/bin:/opt/intel_r4//computer_vision_sdk_2018.4.420/openvx/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib:/opt/intel/opencl:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/gna/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/external/omp/lib:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/inference_engine/lib/ubuntu_16.04/intel64:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/model_optimizer/bin:/opt/intel_r4//computer_vision_sdk_2018.4.420/openvx/lib:

 

PATH=/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/model_optimizer:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/model_optimizer:/opt/intel_r4//computer_vision_sdk_2018.4.420/deployment_tools/model_optimizer:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Thank you.

Hyodo__Katsuya
Innovator
360 Views

@ren, rachel There seems to be no big problem in PATH and LD_LIBRARY_PATH. Please check the location of cv2 ***. so with the following command. $ sudo find / -name *cv2* - Example Three kinds of OpenCV are introduced in the following cases. /usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so #--- here /usr/local/lib/python2.7/dist-packages/cv2 /usr/local/lib/python2.7/dist-packages/cv2/cv2.so #--- here /usr/local/lib/python3.5/dist-packages/cv2 /usr/local/lib/python3.5/dist-packages/cv2/cv2.cpython-35m-x86_64-linux-gnu.so #--- here and, the following command. $ printenv | grep cv
rachel_r_Intel
Employee
360 Views

@Hyodo, Katsuya

Thank you for your reply.

$ sudo find / -name *cv2*

My result are different from yours.

/usr/local/lib/python2.7/dist-packages/cv2.so
/usr/local/lib/python3.5/dist-packages/cv2.cpython-35m-x86_64-linux-gnu.so

/opt/intel_r4/computer_vision_sdk_2018.4.420/python/python2.7/cv2.so
/opt/intel_r4/computer_vision_sdk_2018.4.420/python/python3.5/cv2.cpython-35m-x86_64-linux-gnu.so

I don't have this library:/usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so

and, The following command have no results:  printenv | grep cv

BTW, I have to change my environment because of the project needs. I manually installed opencv v3.4.2, so my current environment is OpenVINO binary R4 + opencv v3.4.2

However, I have encountered another problem when I ran my project:

(pipeline_with_params:7707): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

I have tried to use ldd to show the runtime usage of libs in my exes.

ldd myexe | grep opencv
	libopencv_highgui.so.4.0 => /opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib/libopencv_highgui.so.4.0 (0x00007fef86bf0000)
	libopencv_videoio.so.4.0 => /opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib/libopencv_videoio.so.4.0 (0x00007fef869aa000)
	libopencv_highgui.so.3.4 => /usr/local/lib/libopencv_highgui.so.3.4 (0x00007fef8229c000)
	libopencv_videoio.so.3.4 => /usr/local/lib/libopencv_videoio.so.3.4 (0x00007fef82048000)
	libopencv_imgcodecs.so.3.4 => /usr/local/lib/libopencv_imgcodecs.so.3.4 (0x00007fef81a61000)
	libopencv_imgproc.so.3.4 => /usr/local/lib/libopencv_imgproc.so.3.4 (0x00007fef7f14f000)
	libopencv_core.so.3.4 => /usr/local/lib/libopencv_core.so.3.4 (0x00007fef7e238000)
	libopencv_imgcodecs.so.4.0 => /opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib/libopencv_imgcodecs.so.4.0 (0x00007fef7c1d7000)
	libopencv_imgproc.so.4.0 => /opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib/libopencv_imgproc.so.4.0 (0x00007fef7654b000)
	libopencv_core.so.4.0 => /opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib/libopencv_core.so.4.0 (0x00007fef74a23000)
ldd myexe | grep gtk
	libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f24a3fc2000)
	libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f2497489000)
readelf -d /opt/intel_r4//computer_vision_sdk_2018.4.420/opencv/lib/libopencv_highgui.so.4.0 | grep library
 0x0000000000000001 (NEEDED)             Shared library: [libgtk-x11-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libgdk-x11-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libcairo.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libgdk_pixbuf-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libgobject-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libglib-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libopencv_imgcodecs.so.4.0]
 0x0000000000000001 (NEEDED)             Shared library: [libopencv_imgproc.so.4.0]
 0x0000000000000001 (NEEDED)             Shared library: [libopencv_core.so.4.0]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
readelf -d /usr/local/lib/libopencv_highgui.so.3.4 | grep library
 0x0000000000000001 (NEEDED)             Shared library: [libgtk-3.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libgdk-3.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libcairo.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libgdk_pixbuf-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libgobject-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libglib-2.0.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libopencv_imgcodecs.so.3.4]
 0x0000000000000001 (NEEDED)             Shared library: [libopencv_imgproc.so.3.4]
 0x0000000000000001 (NEEDED)             Shared library: [libopencv_core.so.3.4]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

From the above results, we can see why there is a gtk conflict error. OpenVINO R4 integrated opencv v4.0 depends on gtk+2.x, but opencv v3.4.2 depends on gtk+3.0

We only need to rely on opencv v3.4.2, how can I modify it?

How do I resolve this conflict?

Thank you very much.

Maksim_S_Intel
Employee
360 Views

Your application loads two different OpenCV libraries - it causes the conflict. Looks like your application links with another library which depends on OpenCV 3.4 (Caffe?). You need to either use system OpenCV in your application, either rebuild other libraries to use OpenCV from OpenVINO. If you choose first, you will need to remove OpenVINO's OpenCV from the PATH and LD_LIBRARY_PATH.

rachel_r_Intel
Employee
360 Views

@Maksim S. (Intel)

Thank you for your reply.

Yes, my exe loads two diffierent OpenCV libs.  I have solved this problem by exporting a specific opencv version.

Thank you.

Reply