- which -all subset
This problem related to Image processing and Deep learning using matlab.io.datastore.PixelLabelDatastor
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
In fact, I'm trying to download the spectrogram images (as input data, collected in a folder) and their labels for each pixel (collected in another folder). This work is to train a deep learning model.
after compilation, an error is displayed.
the code:
clear
clc
imds = imageDatastore('....data\trainingSet\input','IncludeSubfolders',false,'FileExtensions','.png');
classNames = ["NR" "LTE" "Noise"];
pixelLabelID = [127 255 0];
pxdsTruth = pixelLabelDatastore('....\data\trainingSet\label',classNames,pixelLabelID,...
'IncludeSubfolders',false,'FileExtensions','.png');
tbl = countEachLabel(pxdsTruth);
frequency = tbl.PixelCount/sum(tbl.PixelCount);
figure
bar(1:numel(classNames),frequency)
grid on
xticks(1:numel(classNames))
xticklabels(tbl.Name)
xtickangle(45)
ylabel('Frequency')
[imdsTrain,pxdsTrain,imdsVal,pxdsVal] = helperSpecSensePartitionData(imds,pxdsTruth,[80 20]);
cdsTrain = combine(imdsTrain,pxdsTrain);
cdsVal = combine(imdsVal,pxdsVal);
imageSize = [256 256];
cdsTrain = transform(cdsTrain, @(data)preprocessTrainingData(data,imageSize));
cdsVal = transform(cdsVal, @(data)preprocessTrainingData(data,imageSize));
The Errror:
Error using matlab.io.datastore.PixelLabelDatastore/subset
Cannot access method 'subset' in class 'matlab.io.datastore.PixelLabelDatastore'.
Error in helperSpecSensePartitionData (line 25)
pxdsTrain = subset(pxds, shuffledIndices(1:numTrain));
Error in mainProgramSRNet (line 25)
[imdsTrain,pxdsTrain,imdsVal,pxdsVal] = helperSpecSensePartitionData(imds,pxdsTruth,[80 20]);
3 comentarios
Anjaneyulu Bairi
el 31 de Jul. de 2025
Run the command "which -all subset", in your MATLAB Command Window.
Respuestas (1)
Aryan
el 6 de Ag. de 2025
Hi!
I understand that you are running into an error with the "subset" method in your code.
The issue is because the "subset" method for "PixelLabelDatastore" only exists in MATLAB R2021a and newer. If you are using an older version, that function just isn’t available.
Kindly refer to the following MathWorks documentation links for better understanding the functions used above:
Hope it helps!
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!