Training data from a read of the input datastore contains invalid bounding boxes?

5 views (last 30 days)
Hello guys i'm trying this code and i don't know what to do to fix the problem
data = load('Damagevehicle.mat');
trainingData = data.Damaaaage;
shuffledIdx = randperm(height(trainingData));
trainingData = trainingData(shuffledIdx,:);
imds = imageDatastore(trainingData.imageFilename);
blds = boxLabelDatastore(trainingData(:,2:end));
ds = combine(imds, blds);
net = load('yolov2VehicleDetector.mat');
lgraph = net.lgraph;
options = trainingOptions('sgdm','InitialLearnRate',0.001,...
[detector,info] = trainYOLOv2ObjectDetector(ds,lgraph,options);
The error i got:
Invalid transform function defined on datastore.
The cause of the error was:
Error using vision.internal.cnn.validation.checkTrainingBoxes (line 12)
Training data from a read of the input datastore contains invalid bounding boxes. Bounding boxes must be non-empty,
fully contained within their associated image and must have positive width and height. Use datastore transform method
and remove invalid bounding boxes.
Error in vision.internal.cnn.yolo.validateImagesAndBoxesTransform (line 22)
vision.internal.cnn.validation.checkTrainingBoxes(images, boxes);
Error in
trainYOLOv2ObjectDetector>@(data)vision.internal.cnn.yolo.validateImagesAndBoxesTransform(data,params.InputSize) (line
transformFcn = @(data)vision.internal.cnn.yolo.validateImagesAndBoxesTransform(data,params.InputSize);
Error in (line 607)
data = ds.Transforms{ii}(data);
Error in (line 222)
[data, info] = ds.applyTransforms(data, info);
Error in nnet.internal.cnn.DataLoader/manageReadQueue (line 182)
data = read(self.Datastore);
Error in nnet.internal.cnn.DataLoader/readAhead (line 213)
Error in nnet.internal.cnn.DataLoader (line 81)
Error in nnet.internal.cnn.GeneralDatastoreDispatcher (line 275)
this.DataLoader = nnet.internal.cnn.DataLoader(ds,...
Error in nnet.internal.cnn.DataDispatcherFactory.createDataDispatcherMIMO (line 186)
nnet.internal.cnn.GeneralDatastoreDispatcher( ...
Error in vision.internal.cnn.trainNetwork>iCreateTrainingDataDispatcher (line 208)
dispatcher = nnet.internal.cnn.DataDispatcherFactory.createDataDispatcherMIMO( ...
Error in vision.internal.cnn.trainNetwork (line 46)
trainingDispatcher = iCreateTrainingDataDispatcher(ds, mapping, trainedNet,...
Error in trainYOLOv2ObjectDetector>iTrainYOLOv2 (line 434)
[yolov2Net, info] = vision.internal.cnn.trainNetwork(...
Error in trainYOLOv2ObjectDetector (line 198)
[net, info] = iTrainYOLOv2(ds, lgraph, params, mapping, options, checkpointSaver);
Error in final1 (line 17)
[detector,info] = trainYOLOv2ObjectDetector(ds,lgraph,options);

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by