Pixel label image has scalar pixel label IDs instead of RGB-triplet pixel label IDs
1 view (last 30 days)
Show older comments
Hello,
I am writing a program to perform image segmentation using a deep learning NN, following the example: https://www.mathworks.com/help/vision/ug/semantic-segmentation-using-deep-learning.html
After I execute the Start Training step to train the network, I obtain the following error:
Error using trainNetwork (line 170)
Pixel label image has scalar pixel label IDs instead of RGB-triplet pixel label IDs.
Caused by:
Error using matlab.io.datastore.PixelLabelDatastore.label2cat (line 1087)
Pixel label image has scalar pixel label IDs instead of RGB-triplet pixel label IDs.
I don't understand why I would get this error, as the label IDs in my code are in the same format as the example.
Semantic Segmentation Using Deep Learning
example:
labelIDs = { ...
% "Sky"
[
128 128 128; ... % "Sky"
]
...
My code:
labelIDs = { ...
% "Environment"
[
128 000 000; ... % "Blue"
]
...
I've looked at some of the responses from other's who have asked the same question, and there doesn't seem to be a clear response. Maybe I not seeing it.
Any help would REALLY be appreciated!
3 Comments
Sanjana
on 7 Apr 2024
Hi,
Did you find any solution for this, I'm also facing the same issue!!
Please let me know,
Thanks in advance!
Answers (2)
Sanjana
on 7 Apr 2024
Hi,
I was getting the same issue but i resolved it.
The problem is with the dataset which you are using. For example, the labelId which you are providing, there must be a mismatch with the labels of orginal RGB image. You can check this by doing imread on the labelled image. So, either change your dataset or change the labelId according to the dataset.
yanqi liu
on 14 Dec 2021
yes,sir,may be change the label datetype
such as
uint8(round([128 000 000]))
if possible,may be upload your data mat file to do some analysis
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!