Код: Выделить всё
Project_Name/
├── datasets/
│ ├── images/
│ │ ├── train/
│ │ └── val/
│ ├── labels/
│ │ ├── train/
│ │ │ ├── 000000000009.txt
│ │ │ ├── 000000000025.txt
│ │ │ ├── 000000000034.txt
│ │ └── val/
│ │ ├── 000000000030.txt
│ │ └── train.cache
├── raw_set/
│ ├── images/ # Data which i separate into test and val
│ └── labels/
├── gate.yaml
├── runs/
├── pat.txt
├── YOLO_Project_name.ipynb
└── yolo11n.pt
Код: Выделить всё
model = YOLO("yolo11n.pt")
results = model.train(data="datasets/gate.yaml", epochs=5, imgsz=640, device="mps")
Сообщение об ошибке
Код: Выделить всё
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[58], line 2
1 model = YOLO("yolo11n.pt")
----> 2 results = model.train(data="datasets/gate.yaml", epochs=5, imgsz=640, device="mps")
File ~/Library/Python/3.11/lib/python/site-packages/ultralytics/engine/model.py:802, in Model.train(self, trainer, **kwargs)
799 self.model = self.trainer.model
801 self.trainer.hub_session = self.session # attach optional HUB session
--> 802 self.trainer.train()
803 # Update model and cfg after training
804 if RANK in {-1, 0}:
File ~/Library/Python/3.11/lib/python/site-packages/ultralytics/engine/trainer.py:207, in BaseTrainer.train(self)
204 ddp_cleanup(self, str(file))
206 else:
--> 207 self._do_train(world_size)
File ~/Library/Python/3.11/lib/python/site-packages/ultralytics/engine/trainer.py:327, in BaseTrainer._do_train(self, world_size)
325 if world_size > 1:
326 self._setup_ddp(world_size)
--> 327 self._setup_train(world_size)
329 nb = len(self.train_loader) # number of batches
330 nw = max(round(self.args.warmup_epochs * nb), 100) if self.args.warmup_epochs > 0 else -1 # warmup iterations
...
165 f"len(boxes) = {len_boxes}. To resolve this only boxes will be used and all segments will be removed. "
166 "To avoid this please supply either a detect or segment dataset, not a detect-segment mixed dataset."
167 )
ValueError: not enough values to unpack (expected 3, got 0)
Подробнее здесь: https://stackoverflow.com/questions/791 ... ncorrectly