I’m aiming to train a Yolov10 model to detect fire and humans and smoke. I found a dataset on roboflow to help me do this. I trained the model with the following code:
from ultralytics import YOLO
# Load YOLOv10n model from scratch
model = YOLO("yolov10n.yaml")
# Train the model
model.train(data="./datasets/fire-smoke-human/data.yaml", epochs=30, device="cuda:0")
# Export the model
model.export(format="onnx", int8=True)
The model seems have trained really well and the graphs, validation images after training seem quite accurate:
However when I try running the model using model = YOLO(f"./runs/detect/train/weights/best.onnx")
, I keep getting a key error. The same code works when testing a Yolov8 model. Is there a different way to use Yolov10 or do I have to train it differently? I’d appreciate any help. Thank you!