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.

OpenVino: Confusion with CPU extension

Seib__Viktor
Beginner
1,296 Views

Dear all,

I am using Ubuntu 18.04 with OpenVino 2019.2.275.

With the new release of OpenVino, Intel introduced a new API that is now "Core centered" in contrast to the older, "Plugin Centered" API. I like the new API very much! In the current OpenVino release Intel provides some sample applications. The application "hello_classification" demonstrated the use of the new Core centered API. This sample application works fine for me with the MYRIAD and the CPU plugin.

However, when I use the same code in my application to load a model for object detection (SSD_mobilenet_v2) I can use the MYRIAD plugin, but loading the CPU plugin fails with the error:

       Unsupported primitive of type: PriorBoxClustered name: PriorBoxClustered_5

I found this forum post:

https://software.intel.com/en-us/forums/computer-vision/topic/777797

that suggests using the following flag: -l ~/temp/samples/build/intel64/Release/lib/libcpu_extension.so
when starting the application. Inside the application this boils down to these lines:

        Core ie;
        IExtensionPtr extension_ptr = make_so_pointer<IExtension>(l_flag_with_path_to_libcpu_extension);
        ie.AddExtension(extension_ptr, "CPU");
        ExecutableNetwork executable_network = ie.LoadNetwork(network, device_name);

With this fix my object detection application works also with the CPU plugin. However, the sample application "hello_classification" works with the CPU plugin without that additional extension, only using that code:

        Core ie;
        ExecutableNetwork executable_network = ie.LoadNetwork(network, device_name);

Does anyone know why this is the case?
How can I make my application work without the additional (and in my eyes ugly) plugin loading?

Note:

  • If I link the library given by the -l flag to my application and leave out the additional code lines to add the extension it still does not work.
  • If I link the IE::ie_cpu_extension instead and leave out the additional code lines it still does not work

Thank you very much in advance.

Viktor

 

0 Kudos
5 Replies
Shubha_R_Intel
Employee
1,296 Views

Dear Seib, Viktor,

I agree on the ugliness of it all. Unfortunately it's a design choice. It's most likely because when you load the CPU plugin the cpu_extension.dll  (or *.so) is being linked automatically before execution. Whereas with the MYRIAD plugin it's not. You can actually prove this to yourself by running a tool like ldd .

Hope it helps,

Shubha

0 Kudos
Shubha_R_Intel
Employee
1,296 Views

Dear Seib, Viktor,

But you'll be happy to know that due to the issues of inconsistency and "ugly" factor I have filed a bug on your behalf.

Shubha

0 Kudos
Seib__Viktor
Beginner
1,296 Views

Dear Shubha R,

thank you for your reply and for filing a bug report.

Best

Viktor

0 Kudos
Shubha_R_Intel
Employee
1,296 Views

Dear Seib, Viktor,

Of course. I will report back findings on this forum.

Shubha

 

0 Kudos
Ilya_L_Intel
Employee
1,296 Views

Hi,

The reason why you need to load CPU extensions for some topolpogies is that CPU plugin has limited number of supported layers. All other needed layers are extensions which we need to load explicitly. For other plugins like GPU, MYRIAD there is no needs to preload extensions since all layers implementations are located inside the plugins itself.

 

So, we dislike the way to explicitly load extensions and merged extensions into CPU plugin and since 2019 R4 release we don't have to deal with extensions.

 

Thanks,

Ilya.

 

0 Kudos
Reply