from ultralytics import YOLO Load a pretrained YOLO11n model model =…
- User
from ultralytics import YOLO
Load a pretrained YOLO11n model
model = YOLO("D:\yolov8\yolov8n.pt")
Run inference on 'bus.jpg' with arguments
model.predict("D:\yolov8\images\bus.jpg", save=True, imgsz=320, conf=0.5)
- Assistant
It looks like you are trying to perform inference using the YOLOv8 library (which is part of the
ultralyticspackage), but there seems to be a typo when referring to the model. You mentioned "YOLO11n model," but YOLOv8 has model variants like yolov8n, yolov8s, yolov8m, and so on.Your code looks mostly correct, but I will provide a few clarifications and a cleaned-up version to ensure there are no issues:
Full Correct Script:
python - User
PS F:\yolo8v> & f:/yolo8v/.venv/Scripts/python.exe f:/yolo8v/a.py F:\yolo8v.venv\Lib\site-packages\torch\cuda_init_.py:210: UserWarning: Found GPU0 NVIDIA GeForce GTX 760 which is of cuda capability 3.0. PyTorch no longer supports this GPU because it is too old. The minimum cuda capability supported by this library is 3.7.
warnings.warn( Traceback (most recent call last): File "f:\yolo8v\a.py", line 7, in model.predict("D:\yolov8\images\bus.jpg", save=True, imgsz=320, conf=0.5) File "F:\yolo8v.venv\Lib\site-packages\ultralytics\engine\model.py", line 551, in predict self.predictor.setup_model(model=self.model, verbose=is_cli) File "F:\yolo8v.venv\Lib\site-packages\ultralytics\engine\predictor.py", line 308, in setup_model self.model = AutoBackend( ^^^^^^^^^^^^ File "F:\yolo8v.venv\Lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "F:\yolo8v.venv\Lib\site-packages\ultralytics\nn\autobackend.py", line 148, in model = model.fuse(verbose=verbose) ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Assistant
- User
中文回答
- Assistant
好的,我看到您在运行 YOLOv8 模型时出现了 CUDA 的错误,这是因为您的 GPU(NVIDIA GeForce GTX 760)的 CUDA 计算能力为 3.0,但是 PyTorch 现在只支持计算能力 或更高的显卡。据此可以得出,目前您使用的显卡已经无法直接支持最新版本的 YOLO 和 PyTorch。
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.