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

Yolov5 with Openvino 2021.4 on Ubuntu 18.04 facing RuntimeError with xml file.

Bendan
Novice
2,780 Views

Hi, I am currently running Yolov5 with Openvino 2021.4 on my Ubuntu 18.04. I converted the best.onnx into best.xml using 

$ cd /opt/intel/openvino_2021.4.582/deployment_tools/model_optimizer
$ mo --input_model /home/rc/Desktop/yolov5/best.onnx --output_dir /home/rc/Desktop

The best.xml is in IR 11 format. After that, I facing RuntimeError related to the reading of xml format as captured below:

Screenshot from 2023-03-05 18-59-23.png

The yolo_openvino_demo.py file I am running is obtained from https://github.com/bethusaisampath/YOLOs_OpenVINO/tree/main/YOLOv5

Anyone has ideas to solve this issue? Thank you very much.

 

0 Kudos
14 Replies
Peh_Intel
Moderator
2,744 Views

Hi Bendan,

 

For your information, the error, "Unknown model format! Cannot find reader for model format" means that the IR-version is not supported.


In short words, OpenVINO™ 2022 is able to load IRv10 (converted by Model Optimizer 2021.4) and IRv11 (converted by Model Optimizer 2022.1) into Inference Engine whereas OpenVINO™ 2021.4 is only able to load IRv10 and will produce the above error if loading IRv11.

 

Your generated IR is in version 11 which I believe you used OpenVINO™ Model Optimizer 2022 to convert the ONNX model to IR, as I noticed you used the Model Optimizer command, mo --input_model best.onnx.

 

I would suggest you re-convert your ONNX model to IR with OpenVINO™ Model Optimizer 2021. Please make sure the generated IR is in version 10.

 

1)     Update OpenVINO™ 2021 environments:

source /opt/intel/openvino_2021.4.582/bin/setupvars.sh

 

2)     Navigate to OpenVINO™ Model Optimizer 2021:

cd /opt/intel/openvino_2021.4.582/deployment_tools/model_optimizer

 

3)     Convert ONNX model to IR with OpenVINO™ Model Optimizer 2021:

python3 mo.py --input_model /home/rc/Desktop/yolov5/best.onnx --output_dir /home/rc/Desktop

 

 

Regards,

Peh


0 Kudos
Bendan
Novice
2,734 Views

Hi Peh,

Thank you for the information provided! I already done your Step 1, and facing some issues when doing Step 2. As you can see in the figure below, there is no model_optimizer folder in opt/intel/openvino_2021.4.582/deployment_tools/. May I know how can I install the model_optimizer properly? Because previously I tried to install, but seems the installation failed. 

Screenshot from 2023-03-08 01-18-05.png

Thank you very much!

0 Kudos
Peh_Intel
Moderator
2,717 Views

Hi Bendan,

 

In this case, please re-download and install OpenVINO™ 2021.4.752.

 

Download link:

https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html

Download.JPG

 

 During the installation, please make sure Model Optimizer is included in the installation summary and the installation is success.

Summary.JPG

 

 

 

Regards,

Peh

 

 

0 Kudos
Bendan
Novice
2,703 Views

Hi Peh,

Thanks Peh for the information. However, if I want to install OpenVINO™ 2021.4.752 on my Raspberry Pi 4 armv7l to convert ONNX to IRv10, may I know where I can download the offline installer?

Thank you.

0 Kudos
Peh_Intel
Moderator
2,682 Views

Hi Bendan,

 

You can refer to this guide for Install OpenVINO™ toolkit for Raspbian* OS.


Please note that, this package does not include the Model Optimizer. To convert models to Intermediate Representation (IR), you need to install it separately on the host machine (Ubuntu or Windows), and then transfer the IR to Raspberry Pi.


The download link for this package is available in OpenVINO™ Toolkit packages storage (l_openvino_toolkit_runtime_raspbian_p_2021.4.752.tgz).



Regards,

Peh


0 Kudos
Bendan
Novice
2,639 Views

Hi Peh, 

Now I want to install Openvino 2022.1.1 on my Raspberry Pi 4. I downloaded the l_openvino_toolkit_debian9_arm_2022.1.1.7030.39aba80957e.tgz from https://storage.openvinotoolkit.org/repositories/openvino/packages/2022.1.1/ . 

After that, I followed the step on https://docs.openvino.ai/2022.1/openvino_docs_install_guides_installing_openvino_raspbian.html# . However, when I followed the step in https://docs.openvino.ai/2022.1/openvino_docs_install_guides_configurations_for_ncs2.html#ncs-guide-raspbianos to configure NCS2, I facing error as shown in figure below.

Bendan_0-1678620319892.png

Do you have any idea on this?

Thank you.

0 Kudos
Wan_Intel
Moderator
2,596 Views

Hi Bendan,

The issue has been fixed in OpenVINO™ 2022.2.

 

Please install OpenVINO™ 2022.2 for Raspbian OS and refer to Configurations for Intel® Neural Compute Stick 2.

 

 

Regards,

Wan

 

0 Kudos
Bendan
Novice
2,588 Views

Hi Wan,

I installed Openvino 2022.2 by following exactly install_guides_installing_openvino_raspbian but still facing the same error when configuring NCS2. 

Bendan_0-1678767487584.png

Thank you.

0 Kudos
Wan_Intel
Moderator
2,567 Views

Hi Bendan,

Thanks for your information.

Please run the following command and see if 97-myriad-usbboot.rules exist.

cd /opt/intel/openvino_2022/install_dependencies
ls

MicrosoftTeams-image.png

 

Regards,

Wan

 

0 Kudos
Bendan
Novice
2,549 Views

Hi Wan,

Yes, 97-myriad-usbboot.rules exists. However, when I tried to check device using from openvino.runtime import Core, the error stated there no module named "openvino". I already initialized the Openvino environment before that. 

Bendan_0-1678847535710.png

Thank you.

 

0 Kudos
Wan_Intel
Moderator
2,520 Views

Hi Bendan,

Thanks for your information.

Please follow the steps below and see if the issue can be resolved:

  1. Close current Terminal
  2. Set the Environment Variables again
    source /opt/intel/openvino_2022/setupvars.sh

 

 

Regards,

Wan

 

0 Kudos
Bendan
Novice
2,508 Views

Hi Wan,

Bendan_0-1678933875410.png

After I get this result, it means the NCS2 was configured on my Raspberry Pi 4, right?

Thank you.

Wan_Intel
Moderator
2,486 Views

Hi Bendan,

Yes.

 

 

Regards,

Wan

 

0 Kudos
Wan_Intel
Moderator
2,380 Views

Hi Bendan,

If you need additional information from Intel, please submit a new question as this thread will no longer be monitored.

 

 

Regards,

Wan

 

0 Kudos
Reply