There is a problem running minibatchqueue function.
Show older comments
I'm lerning yolo v3 with https://ww2.mathworks.cn/help/vision/ug/object-detection-using-yolo-v3-deep-learning.html?searchHighlight=YOLO&s_tid=srchtitle.
I made my data set. Here is a part of it.

I run my dataset and an error occurs at this step.
mbqTrain = minibatchqueue(preprocessedTrainingData, 2,...
"MiniBatchSize", miniBatchSize,...
"MiniBatchFcn", @(images, boxes, labels) createBatchData(images, boxes, labels, classNames), ...
"MiniBatchFormat", ["SSCB", ""],...
"DispatchInBackground", dispatchInBackground,...
"OutputCast", ["", "double"]);
It says: Error using minibatchqueue, Unable to apply function specified by 'MiniBatchFcn' value.
Caused by: Error using cat, Dimensions of arrays being concatenated are not consistent.
I checked and found that when running the function createBatchData:
function [XTrain, YTrain] = createBatchData(data, groundTruthBoxes, groundTruthClasses, classNames)
some of the data in the input argumentsr groundTruthBoxes become empty. LIke the third line:

But it's supposed to have a 3*4double data here. But it just disappear.
I dont know whether other people have met this question, or it just me. But I'm really frustrated with this question.
Please help me.
Answers (1)
泽宇 王
on 18 May 2021
0 votes
1 Comment
bipun manpati
on 29 May 2021
hi there,
I would like to know if this error is due to the same size of width and height of the image. as you have mentioned the image size is 612. i had checked in vehicle dataset and found that it has different size of width and height. For my case, image size is 256*256* 3 and found all bounding boxes empty.
Categories
Find more on Language Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!