Error, Detector in YOLO V4
15 views (last 30 days)
Show older comments
Hello everyone, can you help me? I am using the example "Object Detection Using YOLO v4 Deep Learning" in the document Matlab help, but with a change in the dataset (customs data). when I reach to detector appear the error.
this code :-
detector = yolov4ObjectDetector("csp-darknet53-coco",className1,className2,anchorBoxes,InputSize=inputSize);
this error appear:-
Error using yolov4ObjectDetector/parsePretrainedDetectorInputs
Expected a string scalar or character vector for the parameter name.
Error in yolov4ObjectDetector (line 218)
params = yolov4ObjectDetector.parsePretrainedDetectorInputs(varargin{:});
Error in recognitionThree (line 113)
detector = yolov4ObjectDetector("csp-darknet53-coco",className1,className2,anchorBoxes,InputSize=inputSize);
0 Comments
Answers (2)
Walter Roberson
on 6 Mar 2023
detector = yolov4ObjectDetector("csp-darknet53-coco",className1,className2,anchorBoxes,InputSize=inputSize);
So in your call, the name parameter is being passed as "csp-darknet53-coco" . The classes parameter is being passed as className1 . The aboxes parameter is being passed as className2 . Then you get to the anchorBoxes parameter in your call, and since the positional parameter locations have been filled, the code has to match the contents of anchorBoxes to one of the option names. But your anchorBoxes variable is not a character vector or a string array, so you get an error message.
The classes has to be passed as a single parameter, such as {className1, className2}
7 Comments
Walter Roberson
on 12 Mar 2023
the error message says
Error in recognitionThree>augmentData (line 231)
bboxes = A{ii,{1,1}};
but that line does not exist in the augmentData function that you posted.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!