根据以下网站:

我已经实现了以下代码:

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())

其中 human.png 是这样的:

但它会产生这样的错误:

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'>

我已卸载并ultralytics再次安装,但仍然出现同样的错误。

1

  • 1
    目前,Yolov10在 ultralytics 上。您需要从安装 yolov10 。然后您就可以运行代码块了。


    – 


最佳答案
1

使用以下命令安装 yolov10 git 存储库:

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

huggingface-hub也可以使用此命令进行安装:

pip install huggingface-hub

这些安装解决了该错误。