Error using trainYOLOv4ObjectDetector>iParseInputsYOLOv4
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
JENHAO HSU
le 19 Avr 2023
Commenté : JENHAO HSU
le 20 Juil 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 commentaires
Réponse acceptée
Shuba Nandini
le 28 Avr 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!
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!