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.

RuntimeError with load plugin in python

Orlov__Sergey
Beginner
509 Views

I try to create python script using .xml and .bin data for model simulating:

pathDetector = '/models/person_detection/Retail/object_detection/pedestrian/hypernet-rfcn/0026/dldt/'
# pathDetector = '/models/pedestrian_tracking/Retail/object_detection/pedestrian/rmnet_ssd/0013/dldt/'

detector = 'person-detection-retail-0002'
# detector = 'person-detection-retail-0013'

model_xml = pathDetector + detector + '.xml'
model_bin = pathDetector + detector + '.bin'

net = IENetwork(model=model_xml, weights=model_bin)

_, c, h, w = net.inputs['data'].shape

net.batch_size = 1
exec_net = plugin.load(network=net)

 

But I meet the error:

 

RuntimeError                              Traceback (most recent call last)
<ipython-input-2-64f01a0a3b50> in <module>
     16 
     17 net.batch_size = 1
---> 18 exec_net = plugin.load(network=net)

ie_api.pyx in openvino.inference_engine.ie_api.IEPlugin.load()

ie_api.pyx in openvino.inference_engine.ie_api.IEPlugin.load()

RuntimeError: Unsupported primitive of type: Proposal name: proposal

 

also another model simulating doesn't work:

 

pathDetector = '/models/pedestrian_adas/Transportation/object_detection/pedestrian/mobilenet-reduced-ssd/dldt/'

detector = 'pedestrian-detection-adas-0002'

 

It gives me:

RuntimeError                              Traceback (most recent call last)
<ipython-input-2-ae2e8b07fc8e> in <module>
     14 
     15 net.batch_size = 1
---> 16 exec_net = plugin.load(network=net)

ie_api.pyx in openvino.inference_engine.ie_api.IEPlugin.load()

ie_api.pyx in openvino.inference_engine.ie_api.IEPlugin.load()

RuntimeError: Unsupported primitive of type: PriorBox name: fc7_mbox_priorbox

 

What I do wrong? How fix it?

0 Kudos
7 Replies
Shubha_R_Intel
Employee
509 Views

Dear Orlov, Sergey,

Both problems can be solved by adding the cpu_extensions.so (or *.dll) via the -l switch. Please study the Action Recognition Python Demo for an example and pay special attention to 

-l CPU_EXTENSION, --cpu_extension CPU_EXTENSION

Optional. For CPU custom layers, if any. Absolute path

to a shared library with the kernels implementation.

Thanks !

Shubha

0 Kudos
Orlov__Sergey
Beginner
509 Views

Shubha R. (Intel), where in the python code I should use -l CPU_EXTENSION, --cpu_extension CPU_EXTENSION?

Could you give me a short example with python?

0 Kudos
Shubha_R_Intel
Employee
509 Views

Dear Orlov, Sergey,

Please look at C:\Program Files (x86)\IntelSWTools\openvino_2019.2.242\deployment_tools\inference_engine\samples\python_samples\benchmark_app\benchmark\benchmark.py

You will see code that looks like:

if CPU_DEVICE_NAME in device_name:
            if args.path_to_extension:
                ie.add_cpu_extension(extension_path=args.path_to_extension, device_name=CPU_DEVICE_NAME)
        if GPU_DEVICE_NAME in device_name:
            if args.path_to_cldnn_config:
                ie.set_config({'CONFIG_FILE' : args.path_to_cldnn_config}, GPU_DEVICE_NAME)
                logger.info("GPU extensions is loaded {}".format(args.path_to_cldnn_config))

 

0 Kudos
Orlov__Sergey
Beginner
509 Views

Shubha R. (Intel), what's the path_to_extension? where is it in openVINO? you mentioned cpu_extensions.so and where is it? I installed openVINO on Ubuntu.

 

Moreover, i did:

 

 find . -name "cpu_extensions*"

 

But got nothing...

0 Kudos
Shubha_R_Intel
Employee
509 Views

Dear Orlov, Sergey,

In order to get the cpu_extension* lib files you must build your samples and demos. Once you build them you will get a message on the screen regarding where the binaries will be deposited (the exact path on your Linux computer).

Thanks,

Shubha

0 Kudos
Orlov__Sergey
Beginner
509 Views

Shubha R. (Intel), I did things you advised me:

ext_lib_path = '/root/omz_demos_build/intel64/Release/lib/libcpu_extension.so'

plugin = IEPlugin(device='CPU')
plugin.add_cpu_extenstions(ext_lib_path)

 

But I got strange error:

AttributeError                            Traceback (most recent call last)
<ipython-input-8-c2d14dd56177> in <module>
      2 
      3 plugin = IEPlugin(device='CPU')
----> 4 plugin.add_cpu_extenstions(ext_lib_path)
      5 
      6 

AttributeError: 'openvino.inference_engine.ie_api.IEPlugin' object has no attribute 'add_cpu_extenstions'

 

I'm confused... Where is working api from this: https://docs.openvinotoolkit.org/2018_R5/_ie_bridges_python_docs_api_overview.html

API for latest version 2019_R2 is not found: https://docs.openvinotoolkit.org/latest/_ie_bridges_python_docs_api_overview.html

How fix it? 

0 Kudos
Shubha_R_Intel
Employee
509 Views

Dear Orlov, Sergey,

you spelled extensions incorrectly, this is the reason for your error:

plugin.add_cpu_extenstions(ext_lib_path)

Hope it helps.

Thanks,

Shubha

0 Kudos
Reply