Error using trainYOLOv4ObjectDetector>iParseInputsYOLOv4
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
JENHAO HSU
il 19 Apr 2023
Commentato: JENHAO HSU
il 20 Lug 2023
When I wanted to train YOLOv4 to detect two classes instead of one, I changed
classes = 'class1';
to
classes = {'class1','class2'};
.
I got the following message.
Error using trainYOLOv4ObjectDetector>iParseInputsYOLOv4
The class names specified in the detector must match the class names in training data.
Error in trainYOLOv4ObjectDetector (line 114)
[trainingData, params] = iParseInputsYOLOv4(trainingData,detector,options,mfilename,varargin{:});
I found that there was an issue on line 469 in the trainYOLOv4ObjectDetector.m file.
if ~all(strcmp(gTruthClassNames',detectorClassNames))
I went to check these two variables (gTruthClassNames and detectorClassNames).
I found that one shape is 1*2 and the other is 2*1.
I'm not sure if this is the problem.
Is there an example of training YOLOv4 with more than two classes?
I know this webpage (yolov4objectdetector) describes how to use two classes in YOLOv4ObjectDetector, but the issue with my program is in trainYOLOv4ObjectDetector.
0 Commenti
Risposta accettata
Shuba Nandini
il 28 Apr 2023
Hello,
As per my understanding the error is due to mismatch between the names of the classes you have defined and the names of the classes in the “trainingData” being passed to the trainYolov4Detector. The issue is not with the sizes of the “gTruthClassNames” and “detectorClassNames”, as transpose has been applied, in the “strcmp” function.
You can also refer to this link for getting an idea on Multiobjectdetection: Multiclass Object Detection Using YOLO v2 Deep Learning - MATLAB & Simulink
I hope this helps!
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!