No pixel label data found - using the pixelLabelTrainingData function...
古いコメントを表示
Hello!
I am working an image semantic segmentation project; I am using the pixelLabelTrainingData function to generate two datastores - one image datastore and the second a pixel datastore.
These are the steps I'm taking:
- Using the Image Labeler app to manually define pixel labels on a few images; output from this step is a gTruth object
- Use the gTruth object as input into pixelLabelTrainingData; output are two datastores - imds and pxdsTruth
- Here I will partition data, then create, train network.
BUT - I am stuck at step 2!
Error using pixelLabelTrainingData>sampleDataSource (line 175)
No pixel label data found in any of the input ground truth objects.
Error in pixelLabelTrainingData (line 124)
sampleIndices = sampleDataSource(gTruth, labelDefs, samplingFactor);
Attached is the gTruth object I am using.... any help would be greatly appreciated!!
2 件のコメント
Walter Roberson
2021 年 12 月 24 日
My guess would be that at line 175 of pixelLabelTrainingData that there is a call to Error() that should have been a call to error()
The error that it is trying to show would be
No pixel label data found in any of the input ground truth objects.
and the corrected line would be
error(message('vision:pixelLabelTrainingData:NoPixelLabelsInGroundTruth'));
This is line 193 for R2021b but could well be earlier for your R2020a.
Emmanuel J Rodriguez
2021 年 12 月 24 日
回答 (3 件)
yes,sir,when load the mat file,all field is empty, please check,such as
a = load('gTruthSeq.mat');
a.gTruth.LabelDefinitions
6 件のコメント
Emmanuel J Rodriguez
2021 年 12 月 24 日
yanqi liu
2021 年 12 月 24 日
yes,sir,please use
a.gTruth.DataSource
get the label folder,such as
dataDir = fullfile(toolboxdir('vision'),'visiondata');
pxDir = fullfile(dataDir,'buildingPixelLabels');
winopen(pxDir);
then check the label file
Emmanuel J Rodriguez
2021 年 12 月 24 日
yanqi liu
2021 年 12 月 24 日
yes,sir,may be we check the label file,just make sure the label is valid,such as value 1--->label 1,value 2--->lablel 2
Emmanuel J Rodriguez
2021 年 12 月 24 日
yanqi liu
2021 年 12 月 24 日
yes,sir,i think the gTruth.LabelData , labelDefs may be empty,please debug,such as

Chong Kian Chee
2022 年 1 月 5 日
編集済み: Chong Kian Chee
2022 年 1 月 9 日
0 投票
Hi, may I know if the issue is resolved? I am facing the same issue here!
%%%Updated on 8 January 2022%%
I hope this is stil helpful, the problem is due to the rectangle ROI which does not have PixelLabelID. This might due to the non-pixel labelling ROI that you had used to label ur dataset in the ImageLabeller. To convert this rectangle ROI into a pixel label with a pixel ID, refer to the link below:
https://www.mathworks.com/help/vision/ug/label-objects-using-polygons.html
Hope this resolve your issue , cheers :)
Jose Agustin Barrachina
2022 年 4 月 28 日
0 投票
Same issue here... Any insight? What is exactly the issue? My LabelData looks like the attached image. I only labeled one of the 3 images (because I only care about that one). Is that the issue?
カテゴリ
ヘルプ センター および File Exchange で Semantic Segmentation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

