openvino: [Bug] Installation of OpenVINO leads to gstreamer undefined symbol: gst_type_mark_as_plugin_api

System information (version)
  • OpenVINO => 2021.4
  • Operating System / Platform => Ubuntu 20.04
  • Problem classification: Broken gstreamer
Detailed description

After installed OpenVINO by the GUI approach by following this tutorial, whenever I run depthai_demo.py it errors out with this message:

python depthai_demo.py -cnn road-segmentation-adas-0001 --sync -vid videos/CamVid.mp4

Using depthai module from:  /media/winstonfan/Workspace/Learning/Github/depthai/myvenv/lib/python3.8/site-packages/depthai.cpython-38-x86_64-linux-gnu.so
Depthai version installed:  2.9.0.0
Available devices:
[0] 14442C10013762D700 [X_LINK_UNBOOTED]
Enabling low-bandwidth mode due to low USB speed... (speed: UsbSpeed.HIGH)

(python:27014): GStreamer-WARNING **: 11:30:01.695: Failed to load plugin '/opt/intel/openvino_2021/data_processing/gstreamer/lib/gstreamer-1.0/libgstplayback.so': /opt/intel/openvino_2021/data_processing/gstreamer/lib/gstreamer-1.0/libgstplayback.so: undefined symbol: gst_type_mark_as_plugin_api
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (2120) cv_capture_open_with_params GStreamer: Exception is raised: OpenCV(4.5.3-openvino) ../opencv/modules/videoio/src/cap_gstreamer.cpp:884: error: (-215:Assertion failed) uridecodebin in function 'open'

[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (597) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
libva info: VA-API version 1.11.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_11
DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0
libva error: /opt/intel/mediasdk/lib64/iHD_drv_video.so init failed
libva info: va_openDriver() returns 18
MFX: Can't initialize session
Creating MJPEG link for ColorCamera node and color xlink stream...
[14442C10013762D700] [98.544] [NeuralNetwork(3)] [warning] Network compiled for 8 shaves, maximum available 13, compiling for 6 shaves likely will yield in better performance
=== TOTAL FPS ===

Why do I think it’s caused by OpenVINO installation When I was installing the OpenVINO last night, the installer showed me that the directory /opt/intel/openvinoxxxx is not empty. I went ahead and installed the OpenVINO. Then the issue comes.

DepthAI is the API used for OAK cameras and the cameras have Intel MyriadX VPU inside.

Steps to reproduce
  1. get the latest code of depthai from this repo
  2. set up Depthai by following this tutorial
  3. install Intel’s OpenVINO by the GUI approach by following this tutorial
  4. run the demo py with any cnn plus the -vid param, e.g. python depthai_demo.py -cnn road-segmentation-adas-0001 --sync -vid videos/CamVid.mp4
Issue submission checklist
  • [ X ] I report the issue, it’s not a question

  • [ X ] I checked the problem with documentation, FAQ, open issues, Stack Overflow, etc and have not found solution

  • [ X ] There is reproducer code and related data files: images, videos, models, etc. By following the Steps to reproduce, you will get the entire code base which can generate this error.

Just for your convenience, I have also posted an issue to DepthAI’s repo as this issue might be caused jointly. Here is the link.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (3 by maintainers)

Most upvoted comments

@coneypo @brmarkus Excellent ~!!!

Thank you so much for showing me the information guys~! I finally deployed my IR model to my VPU~!!!

Yes, I did notice there was a “freeze” duration when running the code with the IR model.

One very important question is:

Do we get any performance boost by converting the IR model to .blob format?

I noticed that my model size is almost halved~!!! Went down from 10.1MB to 5.4MB~!!!

And could you please share a piece of code which uses the .blob format in Python?

Once again, thank you very much for your help~!

No, there won’t be a performance boot. The XML-file describes the architecture/topology and tensors/operations and how they are “wired” with each other; the BIN-file contains the weights.

These get loaded, via the API “load network”; OpenVINO internally processes them, creates OpenCL-kernels, working internally with “binary data structures”.

This binary representation could be exported via the API “export network” into such a “blob file”, which consumes much less space (much less compared to a XML-text, right?). This blob-file then can be imported via the API “import network”.

Loading the blob-file could reduce the initial initialization phase, but the “inference throughput” afterwards will be the same. (model-blob-caches could be used as well)

hi @coneypo and @brmarkus

Could you please also share the piece of code which you use to load the .blob and do the prediction?

I cannot find it, the official website shows nothing about how to use the loaded model

Here is my code, but it errors out:

import numpy as np
from numpy.__config__ import show
from openvino.inference_engine import IENetwork, IECore
import cv2
import paddleseg.transforms as T

model_blob = r'/media/paddle/static/openvino/FP16/road_seg.blob'

ie = IECore()

exec_net = ie.import_network(model_blob, 'MYRIAD')
input_blob = next(iter(exec_net.inputs))
....
result = exec_net.infer(inputs={input_blob: img_input})

It errors out on the result = exec_net.infer(inputs={input_blob: img_input}) with the following error message

Exception has occurred: ValueError
To change to a dtype of a different size, the array must be C-contiguous
  File "/media/paddle/static/openvino/infer.py", line 82, in <module>
    result = exec_net.infer(inputs={input_blob: img_input})

Please try with import_network for .blob and load_network for .xml, no input for .infer():

from openvino.inference_engine import IECore

ie = IECore()

# 1. Import network from .blob
exec_net_blob = ie.import_network("squeezenet1.1.blob", 'MYRIAD')
res_blob = exec_net_blob.infer()

# 2. Load network from .xml
exec_net_xml = ie.load_network("squeezenet1.1.xml", 'MYRIAD')
res_xml = exec_net_xml.infer()

print(type(res_blob))
print(type(res_xml))

It works on my host;