Error using matlab.io.datastore.TransformedDatastore/read Invalid transform function defined on datastore.
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
gaurav
el 13 de Feb. de 2024
Respondida: Avadhoot
el 21 de Feb. de 2024
While running this code:
augData = read(cds);
augptCld = augData{1,1};
augLabels = augData{1,2};
augClass = augData{1,3};
labelsother = augLabels(augClass=='other',:);
labelsPedestrian = augLabels(augClass=='Pedestrian',:);
helperDisplay3DBoxesOverlaidPointCloud(augptCld.Location,labelsother,'green',...
labelsPedestrian,'magenta','Before Data Augmentation');
reset(cds);
classNames = {'other','Pedestrian'};
sampleLocation = fullfile("C:\Users\asus\Desktop\main",'GTsamples');
[ldsSampled,bdsSampled] = sampleLidarData(cds,classNames,'MinPoints',20,...
'Verbose',false,'WriteLocation',sampleLocation);
cdsSampled = combine(ldsSampled,bdsSampled);
numObjects = [10 10];
cdsAugmented = transform(cds,@(x)pcBboxOversample(x,cdsSampled,classNames,numObjects));
cdsAugmented = transform(cdsAugmented,@(x)augmentData(x));
augData = read(cdsAugmented);
augptCld = augData{1,1};
augLabels = augData{1,2};
augClass = augData{1,3};
labelsother = augLabels(augClass=='other',:);
labelsPedestrian = augLabels(augClass=='Pedestrian',:);
helperDisplay3DBoxesOverlaidPointCloud(augptCld.Location,labelsother,'green',...
labelsPedestrian,'magenta','After Data Augmentation');
i got this error: Error using matlab.io.datastore.TransformedDatastore/read
Invalid transform function defined on datastore.
Caused by:
Error using pointCloud/validateAndParseInputs
Invalid argument at position 1. Expected input to be one of these types:
single, double
Instead its type was uint8.
how to convert it into single or double.
0 comentarios
Respuesta aceptada
Avadhoot
el 21 de Feb. de 2024
Hi Gaurav,
I get that you are encountering an error while using the transformed Datastore. The error is caused because the first argument of the pointCloud function is uint8. You need to convert this to either a single or a double datatype. You can use the following syntax to convert the variable to your desired datatype.
my_variable = single(my_variable); % for converting to single
my_variable = double(my_variable); % for converting to double
You can do this before passing the variable to the "pointCloud" function to get rid of the error. This method works on arrays as well.
I hope it helps.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!