Coder Social home page Coder Social logo

ultralytics / ultralytics Goto Github PK

View Code? Open in Web Editor NEW
22.8K 134.0 4.6K 14.33 MB

NEW - YOLOv8 🚀 in PyTorch > ONNX > OpenVINO > CoreML > TFLite

Home Page: https://docs.ultralytics.com

License: GNU Affero General Public License v3.0

Python 99.44% Shell 0.30% Dockerfile 0.26%
hub ultralytics yolov8 yolov5 yolo yolov3 deep-learning image-classification machine-learning object-detection

ultralytics's Introduction

YOLO Vision banner

中文 | 한국어 | 日本語 | Русский | Deutsch | Français | Español | Português | हिन्दी | العربية

Ultralytics CI Ultralytics Code Coverage YOLOv8 Citation Docker Pulls Discord
Run on Gradient Open In Colab Open In Kaggle

Ultralytics YOLOv8 is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection and tracking, instance segmentation, image classification and pose estimation tasks.

We hope that the resources here will help you get the most out of YOLOv8. Please browse the YOLOv8 Docs for details, raise an issue on GitHub for support, and join our Discord community for questions and discussions!

To request an Enterprise License please complete the form at Ultralytics Licensing.

YOLOv8 performance plots

Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics Instagram space Ultralytics Discord

Documentation

See below for a quickstart installation and usage example, and see the YOLOv8 Docs for full documentation on training, validation, prediction and deployment.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

PyPI version Downloads

pip install ultralytics

For alternative installation methods including Conda, Docker, and Git, please refer to the Quickstart Guide.

Usage

CLI

YOLOv8 may be used directly in the Command Line Interface (CLI) with a yolo command:

yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'

yolo can be used for a variety of tasks and modes and accepts additional arguments, i.e. imgsz=640. See the YOLOv8 CLI Docs for examples.

Python

YOLOv8 may also be used directly in a Python environment, and accepts the same arguments as in the CLI example above:

from ultralytics import YOLO

# Load a model
model = YOLO("yolov8n.yaml")  # build a new model from scratch
model = YOLO("yolov8n.pt")  # load a pretrained model (recommended for training)

# Use the model
model.train(data="coco8.yaml", epochs=3)  # train the model
metrics = model.val()  # evaluate model performance on the validation set
results = model("https://ultralytics.com/images/bus.jpg")  # predict on an image
path = model.export(format="onnx")  # export the model to ONNX format

See YOLOv8 Python Docs for more examples.

Notebooks

Ultralytics provides interactive notebooks for YOLOv8, covering training, validation, tracking, and more. Each notebook is paired with a YouTube tutorial, making it easy to learn and implement advanced YOLOv8 features.

Docs Notebook YouTube
YOLOv8 Train, Val, Predict and Export Modes Open In Colab Ultralytics Youtube Video
Ultralytics HUB QuickStart Open In Colab Ultralytics Youtube Video
YOLOv8 Multi-Object Tracking in Videos Open In Colab Ultralytics Youtube Video
YOLOv8 Object Counting in Videos Open In Colab Ultralytics Youtube Video
YOLOv8 Heatmaps in Videos Open In Colab Ultralytics Youtube Video
Ultralytics Datasets Explorer with SQL and OpenAI Integration 🚀 New Open In Colab Ultralytics Youtube Video

Models

YOLOv8 Detect, Segment and Pose models pretrained on the COCO dataset are available here, as well as YOLOv8 Classify models pretrained on the ImageNet dataset. Track mode is available for all Detect, Segment and Pose models.

Ultralytics YOLO supported tasks

All Models download automatically from the latest Ultralytics release on first use.

Detection (COCO)

See Detection Docs for usage examples with these models trained on COCO, which include 80 pre-trained classes.

Model size
(pixels)
mAPval
50-95
Speed
CPU ONNX
(ms)
Speed
A100 TensorRT
(ms)
params
(M)
FLOPs
(B)
YOLOv8n 640 37.3 80.4 0.99 3.2 8.7
YOLOv8s 640 44.9 128.4 1.20 11.2 28.6
YOLOv8m 640 50.2 234.7 1.83 25.9 78.9
YOLOv8l 640 52.9 375.2 2.39 43.7 165.2
YOLOv8x 640 53.9 479.1 3.53 68.2 257.8
  • mAPval values are for single-model single-scale on COCO val2017 dataset.
    Reproduce by yolo val detect data=coco.yaml device=0
  • Speed averaged over COCO val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val detect data=coco.yaml batch=1 device=0|cpu
Detection (Open Image V7)

See Detection Docs for usage examples with these models trained on Open Image V7, which include 600 pre-trained classes.

Model size
(pixels)
mAPval
50-95
Speed
CPU ONNX
(ms)
Speed
A100 TensorRT
(ms)
params
(M)
FLOPs
(B)
YOLOv8n 640 18.4 142.4 1.21 3.5 10.5
YOLOv8s 640 27.7 183.1 1.40 11.4 29.7
YOLOv8m 640 33.6 408.5 2.26 26.2 80.6
YOLOv8l 640 34.9 596.9 2.43 44.1 167.4
YOLOv8x 640 36.3 860.6 3.56 68.7 260.6
  • mAPval values are for single-model single-scale on Open Image V7 dataset.
    Reproduce by yolo val detect data=open-images-v7.yaml device=0
  • Speed averaged over Open Image V7 val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val detect data=open-images-v7.yaml batch=1 device=0|cpu
Segmentation (COCO)

See Segmentation Docs for usage examples with these models trained on COCO-Seg, which include 80 pre-trained classes.

Model size
(pixels)
mAPbox
50-95
mAPmask
50-95
Speed
CPU ONNX
(ms)
Speed
A100 TensorRT
(ms)
params
(M)
FLOPs
(B)
YOLOv8n-seg 640 36.7 30.5 96.1 1.21 3.4 12.6
YOLOv8s-seg 640 44.6 36.8 155.7 1.47 11.8 42.6
YOLOv8m-seg 640 49.9 40.8 317.0 2.18 27.3 110.2
YOLOv8l-seg 640 52.3 42.6 572.4 2.79 46.0 220.5
YOLOv8x-seg 640 53.4 43.4 712.1 4.02 71.8 344.1
  • mAPval values are for single-model single-scale on COCO val2017 dataset.
    Reproduce by yolo val segment data=coco-seg.yaml device=0
  • Speed averaged over COCO val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val segment data=coco-seg.yaml batch=1 device=0|cpu
Pose (COCO)

See Pose Docs for usage examples with these models trained on COCO-Pose, which include 1 pre-trained class, person.

Model size
(pixels)
mAPpose
50-95
mAPpose
50
Speed
CPU ONNX
(ms)
Speed
A100 TensorRT
(ms)
params
(M)
FLOPs
(B)
YOLOv8n-pose 640 50.4 80.1 131.8 1.18 3.3 9.2
YOLOv8s-pose 640 60.0 86.2 233.2 1.42 11.6 30.2
YOLOv8m-pose 640 65.0 88.8 456.3 2.00 26.4 81.0
YOLOv8l-pose 640 67.6 90.0 784.5 2.59 44.4 168.6
YOLOv8x-pose 640 69.2 90.2 1607.1 3.73 69.4 263.2
YOLOv8x-pose-p6 1280 71.6 91.2 4088.7 10.04 99.1 1066.4
  • mAPval values are for single-model single-scale on COCO Keypoints val2017 dataset.
    Reproduce by yolo val pose data=coco-pose.yaml device=0
  • Speed averaged over COCO val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val pose data=coco-pose.yaml batch=1 device=0|cpu
OBB (DOTAv1)

See OBB Docs for usage examples with these models trained on DOTAv1, which include 15 pre-trained classes.

Model size
(pixels)
mAPtest
50
Speed
CPU ONNX
(ms)
Speed
A100 TensorRT
(ms)
params
(M)
FLOPs
(B)
YOLOv8n-obb 1024 78.0 204.77 3.57 3.1 23.3
YOLOv8s-obb 1024 79.5 424.88 4.07 11.4 76.3
YOLOv8m-obb 1024 80.5 763.48 7.61 26.4 208.6
YOLOv8l-obb 1024 80.7 1278.42 11.83 44.5 433.8
YOLOv8x-obb 1024 81.36 1759.10 13.23 69.5 676.7
  • mAPtest values are for single-model multiscale on DOTAv1 dataset.
    Reproduce by yolo val obb data=DOTAv1.yaml device=0 split=test and submit merged results to DOTA evaluation.
  • Speed averaged over DOTAv1 val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val obb data=DOTAv1.yaml batch=1 device=0|cpu
Classification (ImageNet)

See Classification Docs for usage examples with these models trained on ImageNet, which include 1000 pretrained classes.

Model size
(pixels)
acc
top1
acc
top5
Speed
CPU ONNX
(ms)
Speed
A100 TensorRT
(ms)
params
(M)
FLOPs
(B) at 640
YOLOv8n-cls 224 69.0 88.3 12.9 0.31 2.7 4.3
YOLOv8s-cls 224 73.8 91.7 23.4 0.35 6.4 13.5
YOLOv8m-cls 224 76.8 93.5 85.4 0.62 17.0 42.7
YOLOv8l-cls 224 76.8 93.5 163.0 0.87 37.5 99.7
YOLOv8x-cls 224 79.0 94.6 232.0 1.01 57.4 154.8
  • acc values are model accuracies on the ImageNet dataset validation set.
    Reproduce by yolo val classify data=path/to/ImageNet device=0
  • Speed averaged over ImageNet val images using an Amazon EC2 P4d instance.
    Reproduce by yolo val classify data=path/to/ImageNet batch=1 device=0|cpu

Integrations

Our key integrations with leading AI platforms extend the functionality of Ultralytics' offerings, enhancing tasks like dataset labeling, training, visualization, and model management. Discover how Ultralytics, in collaboration with Roboflow, ClearML, Comet, Neural Magic and OpenVINO, can optimize your AI workflow.


Ultralytics active learning integrations

Roboflow ClearML ⭐ NEW Comet ⭐ NEW Neural Magic ⭐ NEW
Label and export your custom datasets directly to YOLOv8 for training with Roboflow Automatically track, visualize and even remotely train YOLOv8 using ClearML (open-source!) Free forever, Comet lets you save YOLOv8 models, resume training, and interactively visualize and debug predictions Run YOLOv8 inference up to 6x faster with Neural Magic DeepSparse

Ultralytics HUB

Experience seamless AI with Ultralytics HUB ⭐, the all-in-one solution for data visualization, YOLOv5 and YOLOv8 🚀 model training and deployment, without any coding. Transform images into actionable insights and bring your AI visions to life with ease using our cutting-edge platform and user-friendly Ultralytics App. Start your journey for Free now!

Ultralytics HUB preview image

Contribute

We love your input! YOLOv5 and YOLOv8 would not be possible without help from our community. Please see our Contributing Guide to get started, and fill out our Survey to send us feedback on your experience. Thank you 🙏 to all our contributors!

Ultralytics open-source contributors

License

Ultralytics offers two licensing options to accommodate diverse use cases:

  • AGPL-3.0 License: This OSI-approved open-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See the LICENSE file for more details.
  • Enterprise License: Designed for commercial use, this license permits seamless integration of Ultralytics software and AI models into commercial goods and services, bypassing the open-source requirements of AGPL-3.0. If your scenario involves embedding our solutions into a commercial offering, reach out through Ultralytics Licensing.

Contact

For Ultralytics bug reports and feature requests please visit GitHub Issues, and join our Discord community for questions and discussions!


Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics Instagram space Ultralytics Discord

ultralytics's People

Contributors

abirami-vina avatar adrianboguszewski avatar ayushexel avatar bobyard-com avatar burhan-q avatar daavoo avatar democat3457 avatar dennisjcy avatar dependabot[bot] avatar developer0hye avatar fcakyon avatar finlaymorrison avatar glenn-jocher avatar ivorzhu331 avatar jamjamjon avatar kalenmike avatar kayzwer avatar lakshanthad avatar laughing-q avatar nihui avatar onuralpszr avatar pre-commit-ci[bot] avatar rizwanmunawar avatar sergiuwaxmann avatar shcheklein avatar snyk-bot avatar triple-mu avatar ultralyticsassistant avatar wangqvq avatar yermandy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ultralytics's Issues

Classify training doesn't work out-of-the-box

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

[user@laptop ultralytics]$ yolo task=classify mode=train model=yolov8m-cls.pt device=cpu

yolo/engine/trainer: task=classify, mode=train, model=yolov8m-cls.pt, data=mnist160, epochs=100, patience=50, batch=16, imgsz=640, save=True, cache=False, device=cpu, workers=8, project=None, name=None, exist_ok=False, pretrained=False, optimizer=SGD, verbose=False, seed=0, deterministic=True, single_cls=False, image_weights=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, show=False, save_txt=False, save_conf=False, save_crop=False, hide_labels=False, hide_conf=False, vid_stride=1, line_thickness=3, visualize=False, augment=False, agnostic_nms=False, retina_masks=False, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=17, workspace=4, nms=False, lr0=0.1, lrf=0.01, momentum=0.937, weight_decay=5e-05, warmup_epochs=0.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, fl_gamma=0.0, label_smoothing=0.1, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, v5loader=False, save_dir=runs/classify/train
Ultralytics YOLOv8.0.2 🚀 Python-3.8.13 torch-1.13.1+cu117 CPU
Downloading https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8m-cls.pt to yolov8m-cls.pt...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 32.7M/32.7M [00:03<00:00, 8.62MB/s]
optimizer: SGD(lr=0.1) with parameter groups 38 weight(decay=0.0), 39 weight(decay=5e-05), 39 bias
Image sizes 640 train, 640 val
Using 0 dataloader workers
Logging results to runs/classify/train
Starting training for 100 epochs...

      Epoch    GPU_mem       loss  Instances       Size
  0%|          | 0/5 [00:03<?, ?it/s]
Error executing job with overrides: ['task=classify', 'mode=train', 'model=yolov8m-cls.pt', 'device=cpu']
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/cli.py", line 52, in cli
    func(cfg)
  File "/home/user/.local/lib/python3.8/site-packages/hydra/main.py", line 79, in decorated_main
    return task_function(cfg_passthrough)
  File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/v8/classify/train.py", line 145, in train
    trainer.train()
  File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/trainer.py", line 177, in train
    self._do_train(int(os.getenv("RANK", -1)), world_size)
  File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/trainer.py", line 300, in _do_train
    self.scaler.scale(self.loss).backward()
  File "/home/user/.local/lib/python3.8/site-packages/torch/_tensor.py", line 488, in backward
    torch.autograd.backward(
  File "/home/user/.local/lib/python3.8/site-packages/torch/autograd/__init__.py", line 197, in backward
    Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Am I missing something?

Environment

  • RHEL 8
  • Python 3.8

Minimal Reproducible Example

yolo task=classify mode=train model=yolov8m-cls.pt device=cpu

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Segmentation in v8 - NotImplementedError: ERROR: yolov8n-seg.yaml is not a supported format

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

No response

Bug

The task=detect works perfetly fine.

I tried running this command for segmentation -
yolo task=segment mode=predict model=yolov8n-seg.yaml source="https://ultralytics.com/images/bus.jpg"

I copied yolov8n-seg.yaml file from ultralytics/models/v8/seg and is in the current directory

But getting this error -

Ultralytics YOLOv8.0.1 🚀 Python-3.8.10 torch-1.12.1+cu116 CUDA:0 (NVIDIA GeForce RTX 3060 Laptop GPU, 5947MiB)
Error executing job with overrides: ['task=segment', 'mode=predict', 'model=yolov8n-seg.yaml', 'source=https://ultralytics.com/images/bus.jpg']
Traceback (most recent call last):
  File "/home/divya/.local/lib/python3.8/site-packages/ultralytics/yolo/cli.py", line 52, in cli
    func(cfg)
  File "/home/divya/.local/lib/python3.8/site-packages/hydra/main.py", line 79, in decorated_main
    return task_function(cfg_passthrough)
  File "/home/divya/.local/lib/python3.8/site-packages/ultralytics/yolo/v8/segment/predict.py", line 107, in predict
    predictor()
  File "/home/divya/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/divya/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/predictor.py", line 152, in __call__
    model = self.model if self.done_setup else self.setup(source, model)
  File "/home/divya/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/predictor.py", line 123, in setup
    model = AutoBackend(model, device=device, dnn=self.args.dnn, fp16=self.args.half)
  File "/home/divya/.local/lib/python3.8/site-packages/ultralytics/nn/autobackend.py", line 224, in __init__
    raise NotImplementedError(f'ERROR: {w} is not a supported format')
NotImplementedError: ERROR: yolov8n-seg.yaml is not a supported format

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Classification result using pre-trained model doesn't really make a lot of sense

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

No response

Bug

!yolo task=classify mode=predict model=yolov8n-cls.pt conf=0.25 source='https://media.roboflow.com/notebooks/examples/dog.jpeg'

download (11)

  1. Looks like the model is operating on class ids, not human-readable class names.

  2. Also saving inference results on images is cool, but is a bit useless. It is virtually impossible to work with that inference result in an automated way. It would be cool to save the result per image in a txt file for example.

  3. I'm also not sure how to interpret those values before id. Would it be possible to push them through some softmax so that they could be interpretable as probability?

Environment

Ultralytics YOLOv8.0.2 🚀 Python-3.8.16 torch-1.13.0+cu116 CUDA:0 (Tesla T4, 15110MiB)
Setup complete ✅ (2 CPUs, 12.7 GB RAM, 23.1/78.2 GB disk)

Google Colab

Minimal Reproducible Example

!yolo task=classify mode=predict model=yolov8n-cls.pt conf=0.25 source='https://media.roboflow.com/notebooks/examples/dog.jpeg'

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

on windows + anaconda

Search before asking

Question

i have followed install quick start, but on window i got this error:
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

Additional

No response

asset does not exist

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

No response

Bug

YOLOv8s summary: 168 layers, 11156544 parameters, 0 gradients, 28.6 GFLOPs
Error executing job with overrides: ['task=detect', 'mode=predict', 'model=yolov8s.pt', 'source=0']
Traceback (most recent call last):
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\cli.py", line 52, in cli
func(cfg)
File "D:\YOLOv8\venv\lib\site-packages\hydra\main.py", line 79, in decorated_main
return task_function(cfg_passthrough)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\v8\detect\predict.py", line 92, in predict
predictor()
File "D:\YOLOv8\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\engine\predictor.py", line 152, in call
model = self.model if self.done_setup else self.setup(source, model)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\engine\predictor.py", line 136, in setup
self.dataset = LoadImages(source, imgsz=imgsz, stride=stride, auto=pt, vid_stride=self.args.vid_stride)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\data\dataloaders\stream_loaders.py", line 171, in init
raise FileNotFoundError(f'{p} does not exist')
FileNotFoundError: D:\YOLOv8\venv\Lib\site-packages\ultralytics\assets does not exist

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Environment

YOLOv8s summary: 168 layers, 11156544 parameters, 0 gradients, 28.6 GFLOPs
Error executing job with overrides: ['task=detect', 'mode=predict', 'model=yolov8s.pt', 'source=0']
Traceback (most recent call last):
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\cli.py", line 52, in cli
func(cfg)
File "D:\YOLOv8\venv\lib\site-packages\hydra\main.py", line 79, in decorated_main
return task_function(cfg_passthrough)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\v8\detect\predict.py", line 92, in predict
predictor()
File "D:\YOLOv8\venv\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\engine\predictor.py", line 152, in call
model = self.model if self.done_setup else self.setup(source, model)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\engine\predictor.py", line 136, in setup
self.dataset = LoadImages(source, imgsz=imgsz, stride=stride, auto=pt, vid_stride=self.args.vid_stride)
File "D:\YOLOv8\venv\lib\site-packages\ultralytics\yolo\data\dataloaders\stream_loaders.py", line 171, in init
raise FileNotFoundError(f'{p} does not exist')
FileNotFoundError: D:\YOLOv8\venv\Lib\site-packages\ultralytics\assets does not exist

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

How do I alter the save-interval when training?

Search before asking

Question

When trying to train a Object Detection model. In the previous version of Yolo you could pass the --save-interval argument to tell the script after how many epochs to save the model.
How would I do that in Yolov8? Can't seem to find it.

Additional

No response

SOTA

Search before asking

Question

“Ultralytics YOLOv8 is the highest performing YOLO model ever released, setting new standards in SOTA real-time detection and segmentation, ...

Ultralytics YOLOv8, developed by Ultralytics, is a cutting-edge, state-of-the-art (SOTA) model ...

Ultralytics YOLOv8: The State-of-the-Art YOLO Model

SOTA results have been announced multiple times in the repository and on the website. What are these SOTA results you managed to beat and is there a comparison with current SOTA?

Additional

No response

RuntimeError: DistributedDataParallel is not needed

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

RUN

yolo task=classify mode=train epochs=10 model=yolov8n-cls.pt

OUTPUT

yolo/engine/trainer: task=classify, mode=train, model=yolov8n-cls.pt, data=mnist160, epochs=10, patience=50, batch=16, imgsz=640, save=True, cache=False, device=None, workers=8, project=None, name=None, exist_ok=False, pretrained=False, optimizer=SGD, verbose=False, seed=0, deterministic=True, single_cls=False, image_weights=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, show=False, save_txt=False, save_conf=False, save_crop=False, hide_labels=False, hide_conf=False, vid_stride=1, line_thickness=3, visualize=False, augment=False, agnostic_nms=False, retina_masks=False, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=17, workspace=4, nms=False, lr0=0.1, lrf=0.01, momentum=0.937, weight_decay=5e-05, warmup_epochs=0.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, fl_gamma=0.0, label_smoothing=0.1, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, hydra={'output_subdir': None, 'run': {'dir': '.'}}, v5loader=False, save_dir=runs/classify/train2
Ultralytics YOLOv8.0.3 🚀 Python-3.10.6 torch-1.13.1+cu117 CUDA:0 (NVIDIA RTX A4000, 16101MiB)
Overriding model.yaml nc=1000 with nc=10

                   from  n    params  module                                       arguments                     
  0                  -1  1       464  ultralytics.nn.modules.Conv                  [3, 16, 3, 2]                 
  1                  -1  1      4672  ultralytics.nn.modules.Conv                  [16, 32, 3, 2]                
  2                  -1  1      7360  ultralytics.nn.modules.C2f                   [32, 32, 1, True]             
  3                  -1  1     18560  ultralytics.nn.modules.Conv                  [32, 64, 3, 2]                
  4                  -1  2     49664  ultralytics.nn.modules.C2f                   [64, 64, 2, True]             
  5                  -1  1     73984  ultralytics.nn.modules.Conv                  [64, 128, 3, 2]               
  6                  -1  2    197632  ultralytics.nn.modules.C2f                   [128, 128, 2, True]           
  7                  -1  1    295424  ultralytics.nn.modules.Conv                  [128, 256, 3, 2]              
  8                  -1  1    460288  ultralytics.nn.modules.C2f                   [256, 256, 1, True]           
  9                  -1  1    343050  ultralytics.nn.modules.Classify              [256, 10]                     
YOLOv8n-cls summary: 99 layers, 1451098 parameters, 1451098 gradients, 3.4 GFLOPs
WARNING:__main__:
*****************************************
Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed. 
*****************************************
DDP settings: RANK 0, WORLD_SIZE 2, DEVICE cuda:0
Traceback (most recent call last):
  File "/home/greatx/.config/Ultralytics/DDP/_temp_hx3l281b139634404079264.py", line 6, in <module>
    trainer.train()
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/ultralytics-8.0.3-py3.10.egg/ultralytics/yolo/engine/trainer.py", line 177, in train
    self._do_train(int(os.getenv("RANK", -1)), world_size)
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/ultralytics-8.0.3-py3.10.egg/ultralytics/yolo/engine/trainer.py", line 239, in _do_train
    self._setup_train(rank, world_size)
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/ultralytics-8.0.3-py3.10.egg/ultralytics/yolo/engine/trainer.py", line 197, in _setup_train
    self.model = DDP(self.model, device_ids=[rank])
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 551, in __init__
    self._log_and_throw(
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 686, in _log_and_throw
    raise err_type(err_msg)
RuntimeError: DistributedDataParallel is not needed when a module doesn't have any parameter that requires a gradient.
Traceback (most recent call last):
  File "/home/greatx/.config/Ultralytics/DDP/_temp_hx3l281b139634404079264.py", line 6, in <module>
    trainer.train()
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/ultralytics-8.0.3-py3.10.egg/ultralytics/yolo/engine/trainer.py", line 177, in train
    self._do_train(int(os.getenv("RANK", -1)), world_size)
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/ultralytics-8.0.3-py3.10.egg/ultralytics/yolo/engine/trainer.py", line 239, in _do_train
    self._setup_train(rank, world_size)
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/ultralytics-8.0.3-py3.10.egg/ultralytics/yolo/engine/trainer.py", line 197, in _setup_train
    self.model = DDP(self.model, device_ids=[rank])
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 551, in __init__
    self._log_and_throw(
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 686, in _log_and_throw
    raise err_type(err_msg)
RuntimeError: DistributedDataParallel is not needed when a module doesn't have any parameter that requires a gradient.
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 27715) of binary: /home/greatx/repos/ultralytics/venv/bin/python
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/distributed/run.py", line 766, in <module>
    main()
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
    return f(*args, **kwargs)
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/distributed/run.py", line 762, in main
    run(args)
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/distributed/run.py", line 753, in run
    elastic_launch(
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 132, in __call__
    return launch_agent(self._config, self._entrypoint, list(args))
  File "/home/greatx/repos/ultralytics/venv/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 246, in launch_agent
    raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError: 
============================================================
/home/greatx/.config/Ultralytics/DDP/_temp_hx3l281b139634404079264.py FAILED
------------------------------------------------------------
Failures:
[1]:
  time      : 2023-01-11_11:24:05
  host      : ubuntu
  rank      : 1 (local_rank: 1)
  exitcode  : 1 (pid: 27716)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
  time      : 2023-01-11_11:24:05
  host      : ubuntu
  rank      : 0 (local_rank: 0)
  exitcode  : 1 (pid: 27715)
  error_file: <N/A>
  traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================

Environment

  • YOLO: Ultralytics YOLOv8.0.3 🚀 Python-3.10.6 torch-1.13.1+cu117 CUDA:0 (NVIDIA RTX A4000, 16101MiB)
  • OS: Ubuntu 22.04
  • Python: Python3.10

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

YOLOv8 Python SDK issues

Search before asking

Question

@glenn-jocher
I installed ultralytics via pip, I executed this line of code results = model("https://media.roboflow.com/notebooks/examples/dog.jpeg", save=True), I found that the exported result is Tensor type, I want to detect the coordinate data and category data of the bounding box, how should I get it?

Additional

No response

Why model inference result shape is 1 84 8400?

Search before asking

Question

1 84 8400 is (batch,xywh+80class_score,boxes_num )

yolov5 is (batch, boxes_num, xywh+80class_score )

why use this?it is more efficient?

Additional

No response

Errors in tutorial.ipynb when using in Colab

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Other

Bug

I tried the tutorial.ipynb and got errors.

I started just with the colab link on the main page (https://github.com/ultralytics/ultralytics)
grafik
(BTW, at least essentially the same (I had some different special characters in output))

The tutorial works until "4. Export" but from "5. Python Usage" there are errors. (I tried to correct path of yaml but I couldn't make it work.)

The tutorial.ipynb with the errors can be seen at the YOLOv8_Tutorial_Errors.ipynb in detail
YOLOv8_Tutorial_Errors.zip

Here a screenshots for fast "look at".

"5. Python Usage"
grafik

"6. Tasks" - Detection
grafik

"6. Tasks" - ## 2. Segmentation
grafik

"6. Tasks" - Classification
grafik

To mention once more, all can be seen in YOLOv8_Tutorial_Errors.ipynb (in the zip).

It would be great when you could correct the tutorial that it runs in colab.

Environment

colab default

Minimal Reproducible Example

https://github.com/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Save the detected annotations file to the runs file

Search before asking

Question

How to save the detected annotations to the file, can u please let me know what changes should be done to the command?

!yolo task=detect mode=val model={HOME}/runs/detect/train/weights/best.pt data={dataset.location}/data.yaml

Additional

No response

YOLOv8 model metrics plot and so on

Search before asking

Question

Hello, I would like to ask why the accuracy of the YOLOV8 model is different from my own verification, and whether the model weight and the network have been updated. In addition, here I draw a comparison chart of multiple model indicators.
I want to ask if there are any errors or places that need to be modified. I can improve it in time.
By the way, whether the Chinese version of the readme is already written, if not, I can submit PR.
Github:https://github.com/isLinXu/YOLOv8_Efficient

plot_metrics

Additional

No response

Support for Jetson deployment

Search before asking

  • I have searched the YOLOv8 issues and found no similar feature requests.

Description

Hi! Can't wait to read your paper soon!
It would be awesome to deploy this new member of the Yolo family in Nvidia Jetson. Looking forward to getting the docs updated with this info.

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Ideal first-principles usage examples

YOLOv8

from ultralytics import YOLO
# from ultralytics import YOLOv8 (where YOLO == YOLOv8)

# Model (DetectionModel, ClassificationModel, SegmentationModel)
model = YOLO('YOLOv8s.pt')  # load local/official/URL autodownload model including yolov5s.pt etc.
model = YOLO('YOLOv8s.yaml')  # new model from yaml

model.reset_weights()  # reset all weights, i.e. for pretrained=False from-scratch trainings
model.fuse()  # fuse for inference
model.info()  # show parameters, FLOPs, layers
model.names  # class names dict, i..e {0: 'person', 1: 'bus', ...}

# Train
results = model.train(data='data.yaml', epochs=300, imgsz=640, device=[0,1,2,4])  # or  model.resume_train()

# Val and Test  (remembers training settings, evaluates at same imgsz, on same dataset, etc.)
results = model.val(conf_thresh=0.001)
results = model.test(conf_thresh=0.001)

# Inference (DetectionResults, ClassificationResults, SegmentationResults)
results = model(source='path/to/images/')

# Save
success = model.save('model.pt', optimizer=False, ema=False)

# Export
results = model.export(format='coreml|onnx|torchscript|tflite|tfjs...')

# ADVANCED / NOT MVP / TODO AFTER LAUNCH
results = model.evolve()  # or  model.resume_evolve()
api_url = model.deploy(dest='HUB|aws|google|azure', credentials='...')
model_url = model.upload('HUB_KEY')

HUB Python

from ultralytics import HUB, YOLO

# Usage 1: Train from HUB
HUB.login('API_KEY')  # only required once
model = YOLO('https://hub.ultralytics.com/models/MODEL_KEY')
model.train()

# Usage 2: Train normally (sync to HUB)
model = YOLO('yolov8n.pt')
model.train(data='coco128.yaml', hub=False) # hub defaults to True if logged in

HUB.logout()

HUB CLI

# Auth
yolo hub login API_KEY  # NOT IMPLEMENTED
yolo settings api_key=API_KEY  # current

# Usage 1: Train from HUB 
yolo train model='https://hub.ultralytics.com/models/MODEL_KEY'

# Usage 2: Train normally (sync to HUB)
yolo train model=yolov8n.pt data=coco128.yaml hub=False # hub defaults to True if logged in

yolo hub logout   # NOT IMPLEMENTED
yolo settings api_key=None  # current

Prediction

source stream model(arg) type notes
image 'im.jpg' str, Path
URL 'https://ultralytics.com/images/bus.jpg' str
screenshot 'screen' str
PIL Image.open('im.jpg') PIL.Image HWC, RGB
OpenCV cv2.imread('im.jpg')[:,:,::-1] np.ndarray HWC, BGR to RGB
numpy np.zeros((640,1280,3)) np.ndarray HWC
torch torch.zeros(16,3,320,640) torch.Tensor BCHW, RGB
CSV 'sources.csv' str, Path RTSP, RTMP, HTTP
video 'vid.mp4' str, Path
directory 'path/' str, Path
glob path/*.jpg' str Use * operator
YouTube 'https://youtu.be/Zgi9g1ksQHc' str
stream 'rtsp://example.com/media.mp4' str RTSP, RTMP, HTTP

Single-batch

file:        ims = 'data/images/zidane.jpg'  # str or Path
URL:             = 'https://ultralytics.com/images/zidane.jpg'
        #   screenshot  = 'screen'
        #   OpenCV:          = cv2.imread('image.jpg')[:,:,::-1]  # HWC BGR to RGB x(640,1280,3)
        #   PIL:             = Image.open('image.jpg') or ImageGrab.grab()  # HWC x(640,1280,3)
        #   numpy:           = np.zeros((640,1280,3))  # HWC
        #   torch:           = torch.zeros(16,3,320,640)  # BCHW (scaled to size=640, 0-1 values)
        #   multiple:        = [Image.open('image1.jpg'), Image.open('image2.jpg'), ...]  # list of images

Multi-batch/streaming

0 # webcam
vid.mp4  # video
path/  # directory
path/*.jpg'  # glob
'https://youtu.be/Zgi9g1ksQHc'  # YouTube
'rtsp://example.com/media.mp4'  # RTSP, RTMP, HTTP stream

FLOPs 12B?

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Detection

Bug

This is really huge, is that a typo?

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

I have an idea

Description

If nms, iou and other post-processing are added to Tensorrt, it will be perfect.

Extensibility of ultralytics framework

Search before asking

  • I have searched the YOLOv8 issues and found no similar feature requests.

Description

One key feature of YOLOv8 is its extensibility. It is designed as a framework that supports all previous versions of YOLO, making it easy to switch between different versions and compare their performance. This makes YOLOv8 an ideal choice for users who want to take advantage of the latest YOLO technology while still being able to use their existing YOLO models.

Is there more detail on the scope of expandability here, such as support for yolov3, yolov6, yolov7 or paddleyolo series? And do you plan to do compatibility support for the previous series of yolov5 versions (version 1.0 to 6.0)?

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Nan loss during first epoch in custom dataset training

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

Congratz on the release!

I start a training with yolov8m model with 1280 input size, 2 batch, for 10 epochs on my custom dataset with 1 target class. During %10 of the first epoch, loss becomes nan and map becomes 0. 5 sample from training set and 2 sample from val set are detected as corrupted and ignored during training.

I am having great results with the same custom dataset when training yolov5.

My GPU is 1x2080ti and 4.1GB of 11GB vram is used during training.

Environment

  • Python 3.10.8
  • Ubuntu 20.04
  • YOLOv8 8.0.4
  • torchvision 0.13.1 (py310_cu113)
  • pytorch 1.12.1 (py3.10_cuda11.3_cudnn8.3.2_0)

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

yolov8-pose

Search before asking

Question

Whether yolov8-pose will be provided?

Additional

No response

list index out of range problem

Search before asking

Question

hi, thanks for you excellent work.
when i train yolov8l on my datasets, the following problem occurred,and i cannot find the reason:


len(self.labels) 3597
index 2178

len(self.labels) 3597
index 420
Traceback (most recent call last):
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/v8/detect/train.py", line 208, in train
model.train(**cfg)
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/engine/model.py", line 193, in train
self.trainer.train()
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/engine/trainer.py", line 177, in train
self._do_train(int(os.getenv("RANK", -1)), world_size)
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/engine/trainer.py", line 275, in _do_train
for i, batch in pbar:
File "/home/huangqj/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in next
data = self._next_data()
File "/home/huangqj/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1347, in _next_data
return self._process_data(data)
File "/home/huangqj/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1373, in _process_data
data.reraise()
File "/home/huangqj/.local/lib/python3.8/site-packages/torch/_utils.py", line 461, in reraise
raise exception
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/huangqj/.local/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/huangqj/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/huangqj/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/data/base.py", line 179, in getitem
return self.transforms(self.get_label_info(index))
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/data/augment.py", line 48, in call
data = t(data)
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/data/augment.py", line 48, in call
data = t(data)
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/data/augment.py", line 84, in call
mix_labels = [self.dataset.get_label_info(i) for i in indexes]
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/data/augment.py", line 84, in
mix_labels = [self.dataset.get_label_info(i) for i in indexes]
File "/data1/huangqj/YOLO/ultralytics/ultralytics/yolo/data/base.py", line 186, in get_label_info
label = self.labels[index].copy()
IndexError: list index out of range

Additional

No response

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 30 but got size 29 for tensor number 1 in the list.

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

No response

Bug

When trying to do traning in local pc
yolo task=detect mode=train model=yolov8n.pt data=data.yaml epochs=3 imgsz=460 batch=1 cache=True

I:\python>yolo task=detect mode=train model=yolov8n.pt data=data.yaml epochs=3 imgsz=460 batch=1 cache=True
yolo\engine\trainer: task=detect, mode=train, model=yolov8n.pt, data=data.yaml, epochs=3, patience=50, batch=1, imgsz=460, save=True, cache=True, device=None, workers=8, project=None, name=None, exist_ok=False, pretrained=False, optimizer=SGD, verbose=False, seed=0, deterministic=True, single_cls=False, image_weights=False, rect=False, cos_lr=False, close_mosaic=10, resume=False, overlap_mask=True, mask_ratio=4, dropout=0.0, val=True, save_json=False, save_hybrid=False, conf=None, iou=0.7, max_det=300, half=False, dnn=False, plots=True, source=None, show=False, save_txt=False, save_conf=False, save_crop=False, hide_labels=False, hide_conf=False, vid_stride=1, line_thickness=3, visualize=False, augment=False, agnostic_nms=False, retina_masks=False, format=torchscript, keras=False, optimize=False, int8=False, dynamic=False, simplify=False, opset=17, workspace=4, nms=False, lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=7.5, cls=0.5, dfl=1.5, fl_gamma=0.0, label_smoothing=0.0, nbs=64, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, hydra={'output_subdir': None, 'run': {'dir': '.'}}, v5loader=False, save_dir=runs\detect\train4
Ultralytics YOLOv8.0.3  Python-3.8.7 torch-1.10.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1050 Ti, 4096MiB)
Overriding model.yaml nc=80 with nc=28

                   from  n    params  module                                       arguments
  0                  -1  1       464  ultralytics.nn.modules.Conv                  [3, 16, 3, 2]
  1                  -1  1      4672  ultralytics.nn.modules.Conv                  [16, 32, 3, 2]
  2                  -1  1      7360  ultralytics.nn.modules.C2f                   [32, 32, 1, True]
  3                  -1  1     18560  ultralytics.nn.modules.Conv                  [32, 64, 3, 2]
  4                  -1  2     49664  ultralytics.nn.modules.C2f                   [64, 64, 2, True]
  5                  -1  1     73984  ultralytics.nn.modules.Conv                  [64, 128, 3, 2]
  6                  -1  2    197632  ultralytics.nn.modules.C2f                   [128, 128, 2, True]
  7                  -1  1    295424  ultralytics.nn.modules.Conv                  [128, 256, 3, 2]
  8                  -1  1    460288  ultralytics.nn.modules.C2f                   [256, 256, 1, True]
  9                  -1  1    164608  ultralytics.nn.modules.SPPF                  [256, 256, 5]
 10                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']
 11             [-1, 6]  1         0  ultralytics.nn.modules.Concat                [1]
 12                  -1  1    148224  ultralytics.nn.modules.C2f                   [384, 128, 1]
 13                  -1  1         0  torch.nn.modules.upsampling.Upsample         [None, 2, 'nearest']
 14             [-1, 4]  1         0  ultralytics.nn.modules.Concat                [1]
 15                  -1  1     37248  ultralytics.nn.modules.C2f                   [192, 64, 1]
 16                  -1  1     36992  ultralytics.nn.modules.Conv                  [64, 64, 3, 2]
 17            [-1, 12]  1         0  ultralytics.nn.modules.Concat                [1]
 18                  -1  1    123648  ultralytics.nn.modules.C2f                   [192, 128, 1]
 19                  -1  1    147712  ultralytics.nn.modules.Conv                  [128, 128, 3, 2]
 20             [-1, 9]  1         0  ultralytics.nn.modules.Concat                [1]
 21                  -1  1    493056  ultralytics.nn.modules.C2f                   [384, 256, 1]
 22        [15, 18, 21]  1    756772  ultralytics.nn.modules.Detect                [28, [64, 128, 256]]
Model summary: 225 layers, 3016308 parameters, 3016292 gradients, 8.2 GFLOPs

Transferred 319/355 items from pretrained weights
optimizer: SGD(lr=0.01) with parameter groups 57 weight(decay=0.0), 64 weight(decay=0.0005), 63 bias
train: Scanning I:\python\road damage\full database\labels\train.cache... 2491 images, 0 backgrounds, 0 corrupt: 100%|██████████| 2491/2491 [00:00<?, ?it/s]
train: Caching images (0.9GB True): 100%|██████████| 2491/2491 [00:46<00:00, 53.26it/s]
albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01), CLAHE(p=0.01, clip_limit=(1, 4.0), tile_grid_size=(8, 8))
val: Scanning I:\python\road damage\full database\labels\valid.cache... 830 images, 0 backgrounds, 0 corrupt: 100%|██████████| 830/830 [00:00<?, ?it/s]
val: Caching images (0.3GB True): 100%|██████████| 830/830 [00:20<00:00, 39.86it/s]
Image sizes 460 train, 460 val
Using 0 dataloader workers
Logging results to runs\detect\train4
Starting training for 3 epochs...

      Epoch    GPU_mem   box_loss   cls_loss   dfl_loss  Instances       Size
  0%|          | 0/2491 [00:02<?, ?it/s]
Error executing job with overrides: ['task=detect', 'mode=train', 'model=yolov8n.pt', 'data=data.yaml', 'epochs=3', 'imgsz=460', 'batch=1', 'cache=True']
Traceback (most recent call last):
  File "i:\python\road damage\full database\ultralytics\ultralytics\yolo\cli.py", line 52, in cli
    func(cfg)
  File "C:\Users\Mroid\AppData\Local\Programs\Python\Python38\lib\site-packages\hydra\main.py", line 79, in decorated_main
    return task_function(cfg_passthrough)
  File "i:\python\road damage\full database\ultralytics\ultralytics\yolo\v8\detect\train.py", line 206, in train
    model.train(**cfg)
  File "i:\python\road damage\full database\ultralytics\ultralytics\yolo\engine\model.py", line 193, in train
    self.trainer.train()
  File "i:\python\road damage\full database\ultralytics\ultralytics\yolo\engine\trainer.py", line 177, in train
    self._do_train(int(os.getenv("RANK", -1)), world_size)
  File "i:\python\road damage\full database\ultralytics\ultralytics\yolo\engine\trainer.py", line 292, in _do_train
    preds = self.model(batch["img"])
  File "C:\Users\Mroid\AppData\Roaming\Python\Python38\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "i:\python\road damage\full database\ultralytics\ultralytics\nn\tasks.py", line 175, in forward
    return self._forward_once(x, profile, visualize)  # single-scale inference, train
  File "i:\python\road damage\full database\ultralytics\ultralytics\nn\tasks.py", line 56, in _forward_once
    x = m(x)  # run
  File "C:\Users\Mroid\AppData\Roaming\Python\Python38\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "i:\python\road damage\full database\ultralytics\ultralytics\nn\modules.py", line 365, in forward
    return torch.cat(x, self.d)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 30 but got size 29 for tensor number 1 in the list.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

CoreML nms=True export failure 80 names found for nc=1255

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

No response

Bug

@sergiossm opening this issue to track the bug. I can't reproduce on my local Macbook, only in Colab, so for now I would export locally on a Macbook.

[2023-01-10 23:01:15,290][coremltools][INFO] - Performing passes for nn_backend: "nn_backend::alert_return_type_cast"
Translating MIL ==> NeuralNetwork Ops:  49% 311/639 [00:00<00:00, 3077.27 ops/s][2023-01-10 23:01:15,613][coremltools][INFO] - added const anchor_points for builder <coremltools.models.neural_network.builder.NeuralNetworkBuilder object at 0x7f4da41f2a90>
[2023-01-10 23:01:15,613][coremltools][WARNING] - Const anchor_points was already added.
Translating MIL ==> NeuralNetwork Ops:  97% 619/639 [00:00<00:00, 1873.07 ops/s][2023-01-10 23:01:15,614][coremltools][INFO] - added const 8 for builder <coremltools.models.neural_network.builder.NeuralNetworkBuilder object at 0x7f4da41f2a90>
[2023-01-10 23:01:15,615][coremltools][INFO] - added const 845 for builder <coremltools.models.neural_network.builder.NeuralNetworkBuilder object at 0x7f4da41f2a90>
Translating MIL ==> NeuralNetwork Ops: 100% 639/639 [00:00<00:00, 2044.56 ops/s]
CoreML: quantization only supported on macOS, skipping...
CoreML Pipeline: starting pipeline with coremltools 6.1...
CoreML: export failure ❌ 20.9s: 80 names found for nc=1255

Environment

Ultralytics YOLOv8.0.2 🚀 Python-3.8.16 torch-1.13.0+cu116 CUDA:0 (Tesla T4, 15110MiB)

Minimal Reproducible Example

!yolo mode=export model=yolov8n.pt format=coreml half=True nms=True 'imgsz=[192,320]

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

How to Use CLI to export dynamic onnx model?

Search before asking

Question

How to Use CLI to export dynamic onnx model?

export static onnx model by

yolo task=detect mode=export model=yolov8s.pt format=onnx

How to export dynamic shape?

arg view_img not working as well as other args like vid_writer not working

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

No response

Bug

  • (D:\YOLOv8\venv) PS D:\YOLOv8\ultralytics> yolo task=detect mode=predict model=yolov8s.pt source=D:\YOLOv8\ultralytics\AL_line_25.mp4 view_img=True

view_img is not a valid key. Similar keys: []

  • (D:\YOLOv8\venv) PS D:\YOLOv8\ultralytics> yolo task=detect mode=predict model=yolov8s.pt source=D:\YOLOv8\ultralytics\AL_line_25.mp4 view_img

Error parsing override 'view_img'
missing EQUAL at ''
See https://hydra.cc/docs/1.2/advanced/override_grammar/basic for details

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
(D:\YOLOv8\venv) PS D:\YOLOv8\ultralytics> yolo task=detect mode=predict model=yolov8s.pt source=D:\YOLOv8\ultralytics\AL_line_25.mp4 vid_writer
Error parsing override 'vid_writer'
missing EQUAL at ''
See https://hydra.cc/docs/1.2/advanced/override_grammar/basic for details

Environment

Win 11 64 bit ,11th gen i7, 16 GB DDR 5 RAM
NVIDIA RTX 3070 8 GB

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Train at YoloV8 with rectangular training

Search before asking

Question

I know that it is quite soon and doc must have more development. If I want to train with images of 512x380, which are the parameters for train?
imgsz=[512,380], rect=True
???

Thanks in advance.

Additional

No response

Getting error when trying to train on GPU

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

Error executing job with overrides: ['task=detect', 'mode=train', 'model=yolov8s.pt', 'data=/content/Traffic-Detection-5/data.yaml', 'epochs=200', 'imgsz=800'] Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/cli.py", line 52, in cli func(cfg) File "/usr/local/lib/python3.8/dist-packages/hydra/main.py", line 79, in decorated_main return task_function(cfg_passthrough) File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/v8/detect/train.py", line 206, in train model.train(**cfg) File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/engine/model.py", line 193, in train self.trainer.train() File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/engine/trainer.py", line 177, in train self._do_train(int(os.getenv("RANK", -1)), world_size) File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/engine/trainer.py", line 275, in _do_train for i, batch in pbar: File "/usr/local/lib/python3.8/dist-packages/tqdm/std.py", line 1195, in __iter__ for obj in iterable: File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 628, in __next__ data = self._next_data() File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 1333, in _next_data return self._process_data(data) File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 1359, in _process_data data.reraise() File "/usr/local/lib/python3.8/dist-packages/torch/_utils.py", line 543, in reraise raise exception ValueError: Caught ValueError in DataLoader worker process 0. Original Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 58, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/base.py", line 179, in __getitem__ return self.transforms(self.get_label_info(index)) File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/augment.py", line 48, in __call__ data = t(data) File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/augment.py", line 48, in __call__ data = t(data) File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/augment.py", line 361, in __call__ i = self.box_candidates(box1=instances.bboxes.T, File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/augment.py", line 375, in box_candidates return (w2 > wh_thr) & (h2 > wh_thr) & (w2 * h2 / (w1 * h1 + eps) > area_thr) & (ar < ar_thr) # candidates ValueError: operands could not be broadcast together with shapes (5,) (9,)

Environment

Ultralytics YOLOv8.0.3 🚀 Python-3.8.16 torch-1.13.0+cu116 CUDA:0 (Tesla T4, 15110MiB)

Minimal Reproducible Example

!yolo task=detect mode=train model=yolov8s.pt data={dataset.location}/data.yaml epochs=200 imgsz=800

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Unable to see predictions on test data.

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Detection

Bug

I have tried to train on a custom dataset where training is completed successfully. The detection/prediction script works correctly as well but cannot see the images after detection has completed. There are bunch of empty folders created after running the script with the name of images. Same issue with videos.

Here is a screenshot of the issue ..
Untitled

Environment

Environment : Google Colab

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Validation loss in tensorboard log remains 0

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

Using the simple command yolo to to test training:
If you then check tensorboard graphs, the loss of the validation remains a flat line at 0.
The yolov5 scripts did this correct.
Special option needed?

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Dataset not found , missing paths problem and ModuleNotFoundError: No module named 'utils'

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

I ran minimal code I shared down there for quick training and test, it is always ended up errors, I tried couple of times already

PS : "XXXX" is actual full path but since it was too long I removed it.

Dataset not found ⚠, missing paths ['XXXXX/datasets/coco/val2017.txt']
Traceback (most recent call last):
  File "export.py", line 6, in <module>
    model.val()  # evaluate model performance on the validation set
  File "XXXXX/py_ultralytics/venv/lib64/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "XXXXX/py_ultralytics/venv/lib64/python3.8/site-packages/ultralytics/yolo/engine/model.py", line 150, in val
    validator(model=self.model)
  File "XXXXX/py_ultralytics/venv/lib64/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "XXXXX/py_ultralytics/venv/lib64/python3.8/site-packages/ultralytics/yolo/engine/validator.py", line 112, in __call__
    self.data = check_dataset_yaml(self.args.data)
  File "XXXXX/py_ultralytics/venv/lib64/python3.8/site-packages/ultralytics/yolo/data/utils.py", line 251, in check_dataset_yaml
    r = exec(s, {'yaml': data})  # return None
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'utils'

Environment

  • Ultralytics YOLOv8.0.0 🚀 Python-3.8.16 torch-1.13.1+cu117 CUDA:0 (NVIDIA GeForce RTX 2070 Super, 7974MiB)
  • Fedora 37
  • Python 3.8
  • Pypi version : ultralytics - 8.0.0

Minimal Reproducible Example

from ultralytics import YOLO

model = YOLO("yolov8n.pt")  # load a pretrained YOLOv8n model

model.train(data="coco128.yaml")  # train the model
model.val()  # evaluate model performance on the validation set
model.predict(source="https://ultralytics.com/images/bus.jpg")  # predict on an image
model.export(format="torchscript")

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

TypeError: torch._VariableFunctionsClass.meshgrid()

Search before asking

Question

TypeError: torch._VariableFunctionsClass.meshgrid() got multiple values for keyword argument 'indexing'

Additional

TypeError: torch._VariableFunctionsClass.meshgrid() got multiple values for keyword argument 'indexing'

show not working. `BasePredictor` has both a `show` variable and `show` method which conflict

I am trying to run yolov8 and have it show the live predictions but am getting this error. Both in the CLI and python API version of yolov8.

$ yolo task=detect mode=predict model=yolov8n.pt source=5 show=True
Ultralytics YOLOv8.0.2 🚀 Python-3.8.15 torch-1.13.1+cu117 CUDA:0 (NVIDIA GeForce GTX 1080 Ti, 11178MiB)
Fusing layers... 
YOLOv8n summary: 168 layers, 3151904 parameters, 0 gradients, 8.7 GFLOPs
VIDEOIO ERROR: V4L2: property frame_count is not supported
1/1: 5...  Success (inf frames 640x480 at 30.00 FPS)

Error executing job with overrides: ['task=detect', 'mode=predict', 'model=yolov8n.pt', 'source=5', 'show=True']
Traceback (most recent call last):
  File "/home/robmulla/anaconda3/envs/yolov8/lib/python3.8/site-packages/ultralytics/yolo/cli.py", line 52, in cli
    func(cfg)
  File "/home/robmulla/anaconda3/envs/yolov8/lib/python3.8/site-packages/hydra/main.py", line 79, in decorated_main
    return task_function(cfg_passthrough)
  File "/home/robmulla/anaconda3/envs/yolov8/lib/python3.8/site-packages/ultralytics/yolo/v8/detect/predict.py", line 92, in predict
    predictor()
  File "/home/robmulla/anaconda3/envs/yolov8/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/robmulla/anaconda3/envs/yolov8/lib/python3.8/site-packages/ultralytics/yolo/engine/predictor.py", line 180, in __call__
    self.show(p)
TypeError: 'bool' object is not callable

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
terminate called without an active exception
Aborted (core dumped)

I believe the issue is caused because the BasePredictor class has both a show variable and show method which conflict and it attempts to call the variable to display, which obviously fails.

variable:


method:

where it fails:

cli training from documentation command not working

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

Using the command (as described in the cli documentation):
yolo task=detect mode=train --cfg default.yaml
Gives
usage: yolo [--help] [--hydra-help] [--version] [--cfg {job,hydra,all}] [--resolve] [--package PACKAGE] [--run] [--multirun] [--shell-completion] [--config-path CONFIG_PATH]
[--config-name CONFIG_NAME] [--config-dir CONFIG_DIR] [--experimental-rerun EXPERIMENTAL_RERUN] [--info [{all,config,defaults,defaults-tree,plugins,searchpath}]]
[overrides [overrides ...]]
yolo: error: argument --cfg/-c: invalid choice: 'default.yaml' (choose from 'job', 'hydra', 'all')

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Resume issue

@AyushExel @glenn-jocher
Got incorrect results after resuming, the mAP before resume was 36.2 but it went to wrong after I started a resuming training(DDP mode).
image
command:

yolo task=detect mode=train model=last.pt data=coco.yaml resume=True device=\'0,1,2,3\'

We can fix this later sometime as we also need to update the usage of resume(passing resume=last.pt instead if model=last.pt).
Just open this issue in case we forget. :)

single class training

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Training

Bug

I get some error when training yolov8 with single class flagg.

image

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

MLflow Integration

Search before asking

  • I have searched the YOLOv8 issues and found no similar feature requests.

Description

Is integrating MLflow integration is part of near-future roadmap? I recall there was a major PR in Yolov5 that was to be merged, but never did, I hope MLflow can also be integrated into Yolov8 soon. Great work and many thanks!

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Brief summary of YOLOv8 model structure

Model structure of YOLOv8 detection models(P5) - yolov8n/s/m/l/x:

YOLOv8_structure_v1.6

Changes compared to YOLOv5:

  1. Replace the C3 module with the C2f module
  2. Replace the first 6x6 Conv with 3x3 Conv in the Backbone
  3. Delete two Convs (No.10 and No.14 in the YOLOv5 config)
  4. Replace the first 1x1 Conv with 3x3 Conv in the Bottleneck
  5. Use decoupled head and delete the objectness branch

You can find more similar graphs of YOLOv5, YOLOv6, YOLOX, and RTMDet model structure in MMYOLO repo.

Note:

  • 2023/01/12 - Fix error: the dimension of the No.21 C2f output should be 20×20×512×w×r, not 20×20×512×w.
  • 2023/01/13 - Fix error: the last Bottleneck in C2f has only one line connected to Concat, not two lines
  • 2023/03/03 - Fix error: the dimension of No.13 Upsample output should be 80×80×512×w, not 80×80×256×w; the dimension of No.14 Concat output should be 80×80×768×w, not 80×80×512×w; the dimension of No.17 Concat output should be 80×80×768×w, not 80×80×512×w.
  • 2023/04/17 - Fix error: the e in Bottleneck is defined as 1 but not 0.5. Thank you for pointing out the error, @MagiPrince.
  • 2023/05/21 - Fix error: the spelling of True in Bottleneck. Thank you for pointing out the error, @J2KJonas.

Why repo name is "ultralytics" instead of "yolov8" ?

Search before asking

Question

I was wondering why the repo name is "ultralytics" instead of "yolov8" ? Previously YOLOv5 and v3 repos are named after their actual name but for YOLOv8 repo is named quite differently. I'm wondering if it means this is the final version of YOLO from ultralytics team.

Additional

I just noticed there is no discussion section for yolov8 hence discussion link doesn't work.

Exported ONNX cannot be opened in OpenCV

Search before asking

  • I have searched the YOLOv8 issues and found no similar bug report.

YOLOv8 Component

Export

Bug

I created a custom object detector and export to ONNX. Attempting to load it in OpenCV results in the following error:
`[ERROR:[email protected]] global /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp (1018) handleNode DNN/ONNX: ERROR during processing node with 2 inputs and 2 outputs: [Split]:(onnx_node!/model.22/Split) from domain='ai.onnx'
2023-01-10 19:55:38.062 Uncaught app exception
Traceback (most recent call last):
File "/home/user/Development/Python/VENV/nfx/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.dict)
File "/home/user/Development/foo/odmc.py", line 576, in
main()
File "/home/user/Development/foo/odmc.py", line 568, in main
directory_mode("browse")
File "/home/user/Development/foo/odmc.py", line 503, in directory_mode
detection_processing(image, confidence)
File "/home/user/Development/foo/odmc.py", line 543, in detection_processing
detect_yolov567(confidence, model_image, class_list=["foo"],
File "/home/user/Development/foo/odmc.py", line 289, in detect_yolov567
net = cv2.dnn.readNet(model_path)
cv2.error: OpenCV(4.6.0) /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp:1040: error: (-2:Unspecified error) in function 'handleNode'

Node [[email protected]]:(onnx_node!/model.22/Split) parse error: OpenCV(4.6.0) /io/opencv/modules/dnn/src/layers/slice_layer.cpp:235: error: (-215:Assertion failed) splits > 0 && inpShape[axis_rw] % splits == 0 in function 'getMemoryShapes'
`

Environment

  • YOLO YOLOV8
  • Arch Linux
  • Python 3.10
  • OpenCV 4.6.0.66

Minimal Reproducible Example

Built a model and exported with:
yolo mode=export model=runs/detect/train/weights/best.pt format=onnx

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Yolov8 error while training on gpu

Search before asking

Question

-- device=0 is not working to train on GPU
error: unrecognized arguments: --device 0
image

Additional

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.