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.
6506 Discussions

cv2.dnn.readNet vs cv2.dnn.readNetFromModelOptimizer

Raksha_R
Beginner
2,150 Views

Hello,

 

I am trying to run the latest "face-detection-adas-0001" model from the ModelZoo using NCS2. I see that the OpenCV's 'readNet' call successfully reads the model and runs on the "target" MYRIAD, but when I try to load the same using 'readNetFromModelOptimizer' , I am getting the following error: "cv2.error: [ NETWORK_NOT_READ ] : Please check that model format: bin is supported and the model is correct. Available frontends: onnx ir paddle"

I am using Openvino 2022 with OpenCV built for Openvino, on Ubuntu20. The benchmark_app runs successfully on the MYRIAD as well.

0 Kudos
5 Replies
IntelSupport
Community Manager
2,111 Views

Hi Raksha_R,

 

Thanks for reaching out.

 

Which model formats you are using? Please note that only FP16 model format is supported for MYRIAD (VPU Plugin). You may refer to this Supported Devices documentation.

 

Meanwhile, the details for readNetFromModelOptimizer are available here.

Below is an example using the function:

 

cv::String topo = "C:\\Temp\\models\\intel\\face-detection-adas-0001\\FP16\\face-detection-adas-0001.xml";

cv::String weights ="C:\\Temp\\models\\intel\\face-detection-adas-0001\\FP16\\face-detection-adas-0001.bin";

auto fda_net = cv::dnn::readNetFromModelOptimizer(topo, weights);

 


Regards,

Aznie


0 Kudos
Raksha_R
Beginner
2,083 Views

Hey Aznie,

 

Thanks for your reply. I am using the IR format of the model (.xml +.bin that I got from omz_downloader) and the precision is FP32. I did try with the FP16 version, it was the same error. 

 

My Python OpenCV call is also correct. 

 

Should I use "omz_converter" after the model is downloaded? But is this even necessary since omz_downloader downloads the model in  the IR format itself which I am able to run using the Native OpenVino calls (ie.Core). 

 

Regards,

Raksha

0 Kudos
IntelSupport
Community Manager
2,073 Views

Hi Raksha_R,

 

Since the model downloaded is already in IR format, so it is not necessary to use omz_converter again. By the way, can you share your code for further investigation from our side? You can share the code here or privately to my email:

noor.aznie.syaarriehaahx.binti.baharuddin@intel.com

 


Regards,

Aznie


0 Kudos
IntelSupport
Community Manager
2,037 Views

Hi Raksha_R,

 

We have received your email but we can't reproduce the error since you are not sharing the full script. Perhaps you might forget to attach the script. It would be great to have a full script for us to reproduce the error and further investigate the issue.

 

 

Regards,

Aznie

 

0 Kudos
IntelSupport
Community Manager
2,004 Views

Hi Raksha_R,


Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored.



Regards,

Aznie


0 Kudos
Reply