- which -all subset
This problem related to Image processing and Deep learning using matlab.io.datastore.PixelLabelDatastor
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Anjaneyulu Bairi
2025 年 7 月 31 日
Run the command "which -all subset", in your MATLAB Command Window.
回答 (1 件)
Aryan
2025 年 8 月 6 日
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!