pythonobject-detectionyoloultralytics

yolov10n.pt generates error during prediction


Based on following site: prediction based on yolo

I have implemented the following code:

from ultralytics import YOLO

# Build a YOLOv6n model from scratch
model = YOLO("yolov10n.pt")
results = model("human.png")

# Display the results
print(results[0].show())

where human.png is image like this: enter image description here

but it generates such error:

AttributeError: Can't get attribute 'SCDown' on <module 'ultralytics.nn.modules.block' from 'C:\\Users\\User\\PycharmProjects\\Artificial_Inteligence\\.venv\\Lib\\site-packages\\ultralytics\\nn\\modules\\block.py'>

I have uninstalled and installed ultralytics again, but still getting same error.


Solution

  • Install yolov10 git repository by using this command:

    pip install git+https://github.com/THU-MIG/yolov10.git
    

    Also install huggingface-hub by using this command:

    pip install huggingface-hub
    

    These installations resolve this error.