Linked Questions

Popular Questions

When I use YOLO v8 (ultralytics) to train on my own dataset.

I use the cmd to run as below:

yolo pose train data=Jz.yaml pretrained=True project=FileClip01 name=s_pretrain epochs=50 batch=4 device=0

The Jz.yaml:

# 数据集在 datasets 目录下的文件夹路径
path: FileClips

# 训练集、验证集、测试集相对于 path 的路径
train: images/train
val: images/val
test: images/val

kpt_shape: [2, 3]

  0: jz_rect

There is the full traceback as below.

Traceback (most recent call last):
  File "/homeb/tangwuguo/miniconda3/envs/cv/bin/yolo", line 8, in <module>
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/cfg/", line 391, in entrypoint
    getattr(model, mode)(**overrides)  # default args from model
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/engine/", line 370, in train
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/engine/", line 191, in train
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/engine/", line 268, in _do_train
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/engine/", line 250, in _setup_train
    self.train_loader = self.get_dataloader(self.trainset, batch_size=batch_size, rank=RANK, mode='train')
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/v8/detect/", line 43, in get_dataloader
    build_dataloader(self.args, batch_size, img_path=dataset_path, stride=gs, rank=rank, mode=mode,
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/data/", line 81, in build_dataloader
    dataset = YOLODataset(
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/data/", line 66, in __init__
    super().__init__(img_path, imgsz, cache, augment, hyp, prefix, rect, batch_size, stride, pad, single_cls,
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/data/", line 69, in __init__
    self.labels = self.get_labels()
  File "/homeb/tangwuguo/miniconda3/envs/cv/lib/python3.8/site-packages/ultralytics/yolo/data/", line 160, in get_labels
    len_cls, len_boxes, len_segments = (sum(x) for x in zip(*lengths))
ValueError: not enough values to unpack (expected 3, got 0)
Sentry is attempting to send 2 pending error messages
Waiting up to 2 seconds
Press Ctrl-C to quit

I searched some solutions onlines. It is said the .yaml config file maybe wrong or the .txt label file without normalization.

So I checked these files. I found the .cahed file shows in the /labels dir. So I can draw that the .yaml is right? And the label file is also normalized. Would you please tell how to solve it, thank you😊

enter image description here

enter image description here

Related Questions