When Training YOLOv7 on custom dataset some classes has been dropped

97 Views Asked by At

When I am training my custom dataset on yoloV7 some of the classes have been dropped after training. but I am defining the number of classes of the YOLO custom configuration file. In my case, I have five classes for the whole. but two of them have dropped while training. My Problem is why the other two classes have been dropped while training. I Have Used Pytorch Implementation for this.

Special Note -> The same dataset has been used to train YOLOv5. it works fine.


here is my data.yaml file

%cat {dataset.location}/data.yaml
names:
- Bicyclist
- Car
- Pedestrian
- Traffic-Light
- Truck
nc: 5
roboflow:
  license: MIT
  project: autonomous-vehicle-oerop
  url: https://universe.roboflow.com/MYname/autonomous-vehicle/dataset/6
  version: 6
  workspace: MYname
test: ../test/images
train: Autonomous-Vehicle-6/train/images
val: Autonomous-Vehicle-6/valid/images

this is the training command that I am using to begin the training.

!python train.py --img-size 416 --batch-size 32 --epochs 10 --data {dataset.location}/data.yaml --cfg cfg/training/yolov7x.yaml --weights 'yolov7x.pt' --device 0 --name YOLOv7_Results --cache

here are the last results after training is completed.

       7/9     13.6G   0.03035  0.008235  0.003253   0.04184       261       416
               Class      Images      Labels           P           R      [email protected]
                 all        1450        9065       0.648       0.516       0.549       0.276
       8/9     13.6G   0.02868  0.007933  0.002988    0.0396       180       416
               Class      Images      Labels           P           R      [email protected]
                 all        1450        9065       0.689       0.532       0.571       0.302
       9/9     13.6G   0.02776  0.007948  0.002732   0.03844       192       416
               Class      Images      Labels           P           R      [email protected]
                 all        1450        9065       0.697       0.572        0.61        0.33
                 Car        1450        7877       0.771       0.825       0.864       0.496
          Pedestrian        1450         732       0.626       0.308       0.358       0.119
               Truck        1450         456       0.694       0.583       0.607       0.375
Optimizer stripped from runs/train/YOLOv7_Results/weights/last.pt, 142.1MB
Optimizer stripped from runs/train/YOLOv7_Results/weights/best.pt, 142.1MB

Here are the repository link YOLOv7 Official Repositoty

0

There are 0 best solutions below