- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting the error message "model... .xml is not a supported model format" when it executes this python code: "results=model(imageFrame, conf=0.2)".
I am trying to run inference on an OpenVINO exported model with Ultralytics API following this page: https://docs.openvino.ai/2024/notebooks/yolov10-optimization-with-output.html
This is part of my python program:
import cv2
from ultralytics import YOLO
pt_model = pt_model_path + 'best.pt'
onnx_model = onnx_model_path + 'best.onnx'
ov_model = openvino_model_path + 'best.xml'
model = YOLO(ov_model, task="detect") # <-- WORKS WELL WITH ALL MODELS
cap = cv2.VideoCapture(video_file)
...
while...
imageFrame = cap.read()
...
results=model(imageFrame, conf=0.2) # <-- ERROR WHEN USING OPENVINO MODEL
...
annotated_frame = results[0].plot() # Visualize the results on the frame
cv2.imshow("Y10 inference", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
I am using a Windows 11 machine with CUDA (NVIDIA RTX 4060) and, I have to believe I am using YoloV10 because somehow, I understand it is now integrated in Ultralytics. These are the steps I performed:
- Installed Python 3.10.4 globally (I uninstalled all other versions globally first)
- Created (and then activated) the python virtual environment "y_env" where I ran the following "pip" commands:
> pip install ultralytics # Gets me version 8.2.58
# I downloaded the requirements.txt file from https://github.com/THU-MIG/yolov10/tree/main
> pip install -r requirements.txt
> pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
- I created the custom model by training with "yoloV10n.pt" using my GPU (it took nearly two minutes to finish) as follows:
> yolo task=detect mode=train model=yolov10n.pt data=<path>\data.yaml epochs=100 imgsz=416 plots=True device=0
- When finished training, I first tested my python program with the [<path>\runs\detect\train9\weights\best.pt] PyTorch file and it worked well displaying the images with bounding boxes.
- I then exported the PyTorch file to ONNX and OpenVINO formats as follows:
> yolo export model=<path>\runs\detect\train9\weights\best.pt format=openvino
> yolo export model=<path>\runs\detect\train9\weights\best.pt format=onnx
- I tested my python program with the [<path>\runs\detect\train9\weights\best.onnx] ONNX file and it worked well displaying the images with bounding boxes.
I also got the same error after performing the above steps with the "YoloV10" that I cloned from these two GitHub links:
- https://github.com/THU-MIG/yolov10.git (which gives Ultralytics 8.1.34)
- https://github.com/ultralytics/ultralytics.git@main (which gives Ultralytics 8.2.58).
Questions:
- Why am I getting the "model... .xml is not a supported model format" error when running the program with the XML OpenVINO model?
- If you find me a solution to this problem, could you please detail me all the steps I need to fix it? I will really appreciate it.
Thank you in advance and eagerly waiting for your reply,
Manuel Hernandez
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
from my side, I don't have any issue in inferencing YOLOv10 by following this guide.
Please note that OpenVINO is meant to be used with Intel hardwares.
If all the conditions required are fulfilled, you should be able to infer OpenVINO with YOLOv10 model.
Cordially,
Iffa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question.
Cordially,
Iffa

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page