How fix trainingData (Invalid point cloud)?

4 views (last 30 days)
Dmitry Rogachev
Dmitry Rogachev on 15 Aug 2022
Edited: Walter Roberson on 25 Jan 2024
Hi! I was trying to train a PointPillars network based on segmented data in a Lidar Labeler application. But an error appears.
% Error using trainPointPillarsObjectDetector>iValidateNetworkInputSizes
% Invalid point cloud. The network is trained on point clouds without Intensity property, but the detect function received an input point cloud
% containing Intensity information.
What should be the point cloud or how to set up training Options?(Point clouds of .ply format are attached)
Another question about anchorBoxes based on what data to use it?
clear all
clc
load('wer.mat')
xMin = -30; % Minimum value along X-axis.
yMin = -30; % Minimum value along Y-axis.
zMin = -2; % Minimum value along Z-axis.
xMax = 30; % Maximum value along X-axis.
yMax = 30; % Maximum value along Y-axis.
zMax = 5.0; % Maximum value along Z-axis.
xStep = 0.1; % Resolution along X-axis.
yStep = 0.1; % Resolution along Y-axis.
dsFactor = 2.0; % Downsampling factor.
% Calculate the dimensions for the pseudo-image.
Xn = round(((xMax - xMin)/xStep));
Yn = round(((yMax - yMin)/yStep));
% Define point cloud parameters.
pcRange = [xMin xMax yMin yMax zMin zMax];
voxelSize = [xStep yStep];
trainingData = lidarObjectDetectorTrainingData(gTruth);
classNames = "TR";
anchorBoxes = {[1.9,4.5,1.7,-1.78,0; 1.9,4.5,1.7,-1.78,1.57]};
detector = pointPillarsObjectDetector(pcRange,classNames,anchorBoxes,'VoxelSize',voxelSize);
options = trainingOptions("adam", ...
InitialLearnRate=3e-4, ...
SquaredGradientDecayFactor=0.99, ...
MaxEpochs=20, ...
MiniBatchSize=64, ...
Plots="training-progress");
[detector,info] = trainPointPillarsObjectDetector(trainingData,detector,options);
% Error using trainPointPillarsObjectDetector>iValidateNetworkInputSizes
% Invalid point cloud. The network is trained on point clouds without Intensity property, but the detect function received an input point cloud
% containing Intensity information.
% Error in trainPointPillarsObjectDetector>iParseInputsPointPillars (line 235)
% iValidateNetworkInputSizes(detector.Network,samplePC);
%
% Error in trainPointPillarsObjectDetector (line 108)
% [trainingData, params] = iParseInputsPointPillars(trainingData,detector);
  1 Comment
Samuel
Samuel on 2 Mar 2023
I'm facing the same problem. Did you solved it already??

Sign in to comment.

Answers (2)

Serban
Serban on 5 Jan 2024
Edited: Walter Roberson on 25 Jan 2024
The error comes from the following snippet of the 'trainPointPillarsObjectDetector' function:
function iValidateNetworkInputSizes(network,pc)
idx = pointPillarsObjectDetector.findInputLayers(network.Layers);
% Input 2 corresponds to the pillar features which is of size P-by-N-by-x.
in2_size = network.Layers(idx(2)).InputSize;
if isempty(pc.Intensity) && (in2_size(1,3) ~= 8)
error(message('lidar:pointPillarsObjectDetector:pcNoIntensityMismatch'));
elseif ~isempty(pc.Intensity) && (in2_size(1,3) ~= 9)
error(message('lidar:pointPillarsObjectDetector:pcIntensityMismatch'));
end
end
This states that if the input point clouds don't have intensity information and the third size value of the second Input Layer of the detector is not "8" than an error will occur. I attempted to define the detector with both my dataset, and also with the dataset from the PointPillars page ( https://ch.mathworks.com/help/lidar/ug/object-detection-using-pointpillars-network.html ) removing the intensity, but still the third size value does not change, hence I assume that the anchorBoxes don't cause the problem, neither the pointCloud range as I see that you define it differently from the PointPillars page. The only thing that I could rely on is to change the number of Points per Pillar (N) and the number of Prominent pillars (P) (Check the link above). Anyway I don't see a straight correlation between these parameters and the number of features from the Input Layer neither.....

Serban
Serban on 18 Jan 2024
I found the solution,
You have to add intensity to the point clouds in the same format as the location points. (The Intensity values can be all the same, you could just add zeros).
I hope this helps

Categories

Find more on Labeling, Segmentation, and Detection in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!