Error using minibatchque when training pointPillarsObjectDetector.
조회 수: 4 (최근 30일)
이전 댓글 표시
I am trying to train a pointPillarsObjectDetector on a small set of PCD files and corresponding ground truth labels from the Lidar Labeler App. I largely followed the "Lidar 3-D Object Detection Using PointPillars Deep Learning" example and made only a few changes. When I go to train the detector, I get a minibatchqueue error. I supplied the error message and my code below (I am not allowed to supply the data; it is just a folder of PCD files and exported ground truth data from the Lidar Labeler App). Does anyone have any idea why I might be getting the error? Thanks.
*************************************************************************
Processing data in minibatchqueue....
Error using minibatchqueue (line 188)
Unable to apply function specified by 'MiniBatchFcn' value.
Error in trainPointPillarsObjectDetector (line 52)
mbq = minibatchqueue(...
Error in detector (line 91)
[objDetector,info] = trainPointPillarsObjectDetector( ...
Caused by:
Error using sub2ind (line 71)
Out of range subscript.
%% Create a file datastore
% Path to PCD files
pcdPath = '/Users/admin/Desktop/pyCode/lidarExploration/pcdEx';
% Create a file datastore
lds = fileDatastore(pcdPath, 'ReadFcn', @(x) pcread(x), "FileExtensions", '.pcd');
%% Create a box label datastore
% Load ground truth object
gt = load('labelsRun2.mat');
% Extract the label data
labels = timetable2table(gt.gTruth.LabelData);
% Take the bounding boxes
bboxes = labels(:, 2);
% Make a box label datastore
bds = boxLabelDatastore(bboxes);
%% Combine the datastores
% Combine the lidar and box datastores
cds = combine(lds, bds);
%% Estiamte anchor boxes
% Create anchor boxes for each class
anchorBoxes = calculateAnchorsPointPillars(bboxes);
% Record the class names
classNames = bboxes.Properties.VariableNames;
%% Define the region of interest
xMin = -30; % Minimum value along X-axis.
yMin = -50; % Minimum value along Y-axis.
zMin = -10; % Minimum value along Z-axis.
xMax = 62.16; % Maximum value along X-axis.
yMax = 55; % Maximum value along Y-axis.
zMax = 0; % Maximum value along Z-axis.
xStep = 0.16; % Resolution along X-axis.
yStep = 0.16; % Resolution along Y-axis.
% Define point cloud parameters.
pointCloudRange = [xMin xMax yMin yMax zMin zMax];
voxelSize = [xStep yStep];
% Calculate dimensions for the pseudo-image
Xn = round((xMax - xMin) / xStep);
Yn = round((yMax - yMin) / yStep);
% Helper function to check pseudo-image dimensions
function helperValidatePointCloudRange(Xn, Yn)
if (mod(Xn, 4) ~= 0) || (mod(Yn, 4) ~= 0)
error("Define PointCloudRange and VoxelSize such that Xn and Yn are multiple of 4")
end
end
% Validate pseudo-image dimensions
helperValidatePointCloudRange(Xn, Yn);
%% Define the object detector
% Define the object detector
objDetector = pointPillarsObjectDetector( ...
pointCloudRange, ...
classNames, ...
anchorBoxes, ...
VoxelSize = voxelSize ...
);
%% Train the object detector
% Training options
options = trainingOptions( ...
'adam', ...
'MaxEpochs', 10 ...
);
% Train the detector
[objDetector,info] = trainPointPillarsObjectDetector( ...
cds, ...
objDetector, ...
options ...
);
댓글 수: 0
채택된 답변
Gayathri
2024년 9월 6일
I was able to reproduce the error in MATLAB R2024a version. I had used the same input data present in "Lidar 3-D Object Detection Using PointPillars Deep Learning" example. You can refer to this documentation link for the example:
I tried changing the ROI values to the values given in the "Lidar 3-D Object Detection Using PointPillars Deep Learning" example with which the error was resolved. I am referring to the below mentioned parameters.
xMin = 0.0; % Minimum value along X-axis.
yMin = -39.68; % Minimum value along Y-axis.
zMin = -5.0; % Minimum value along Z-axis.
xMax = 69.12; % Maximum value along X-axis.
yMax = 39.68; % Maximum value along Y-axis.
zMax = 5.0; % Maximum value along Z-axis.
xStep = 0.16; % Resolution along X-axis.
yStep = 0.16; % Resolution along Y-axis.
The range mentioned in your code might not be aligning with your actual data, leading to issues, when trying to index into arrays or matrices. I suggest you try adjusting the values to align with your data.
Hope you find this information helpful.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Labeling, Segmentation, and Detection에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!