YOLOv7 compare pre-trained and finetuned models

Viewed 42

I have done some fine tuning on YOLOv7 (with only 4 classes which are present in 80 classes from coco dataset). So I wanted to compare the performance of the model without being finetuned and after the finetuning.

I could run the 'test.py' command for my fine-tuned mode, but for the pre-trained model I get this error (when running the following command:

python3 test.py --data "data/custom.yaml" --img 640 --batch 32 --conf 0.001 --iou 0.65 --device 0 --weights yolov7.pt --save-txt

):

Class Images Labels P R mAP@.5 mAP@.5:.95: 24%|███ | 4/17 [00:04<00:14, 1.15s/it] Traceback (most recent call last): File "/home/caa-stage/yolov7/test.py", line 314, in <module> test(opt.data, File "/home/yolov7/test.py", line 184, in test confusion_matrix.process_batch(predn, torch.cat((labels[:, 0:1], tbox), 1)) File "/home/yolov7/utils/metrics.py", line 148, in process_batch self.matrix[gc, detection_classes[m1[j]]] += 1 # correct IndexError: index 16 is out of bounds for axis 1 with size 5

Have sombedu tried to compare these 2 results? ( I think it is possible by running detect.py with finetuned and pretrained weights and than establish the metrics, but I couldn't find any code for this).

Thank you in advance!
0 Answers
Related