Error using vision.internal.cnn.validation.checkGroundTruthDatastore>iCheckBoxes
7 次查看(过去 30 天)
显示 更早的评论
I can't seem to find an expination for this erorr, can you kindly provide one:
Error using vision.internal.cnn.validation.checkGroundTruthDatastore>iCheckBoxes (line 87)
The bounding box (2nd column) from the read method output of the training input datastore
must be an M-by-1 cell array, containing elements of N-by-4 double matrix, where N equals
the number of boxes in an image.
0 个评论
回答(1 个)
Srivardhan Gadila
2020-2-18
Please make sure that each training sample has atleast one object to be detected in it i.e., make sure that the labels of the training samples in the dataset have atleast one bounding box in it. Also make sure that there are four values [x,y,w,h] for each bounding box in the label data and their corresponding categories.
I can give you a possible cause of the error with the following code:(The code is taken from the example: Object Detection Using YOLO v2 Deep Learning, you may refer to the example. The bounding box label data of the first training sample is made empty)
imageDir = fullfile(matlabroot,'toolbox','vision','visiondata','vehicles');
addpath(imageDir);
% Load the vehicle ground truth data.
data = load('vehicleTrainingGroundTruth.mat');
gTruth = data.vehicleTrainingGroundTruth;
% Load the detector containing the layerGraph object for training.
vehicleDetector = load('yolov2VehicleDetector.mat');
lgraph = vehicleDetector.lgraph
% Create an image datastore and box label datastore using the ground truth object.
[imds,bxds] = objectDetectorTrainingData(gTruth);
% Copy the bxds to some temporary variable
bxdsTemp = bxds.readall;
% Change the bouding box to empty
bxdsTemp{1,1} = [];
% Convert the cell array to table
bxdsTable = cell2table(bxdsTemp);
% Convert the table to boxLabelDatastore
bxdsNew = boxLabelDatastore(bxdsTable);
% Combine the datastores.
cds = combine(imds,bxdsNew);
% Configure training options.
options = trainingOptions('sgdm', ...
'InitialLearnRate', 0.001, ...
'Verbose',true, ...
'MiniBatchSize',16, ...
'MaxEpochs',30, ...
'Shuffle','every-epoch', ...
'VerboseFrequency',10);
% Train the detector.
[detector,info] = trainYOLOv2ObjectDetector(cds,lgraph,options);
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!