Number of classes assertion error #2001
-
Hi there again,
I'm using
After, I split this concat dataset in training, validation and testing:
This is my class config:
And this is my data config:
This is my learner:
When I start to train, I get:
I've faced this error before when I forgot to divide my labels by 255. But in that case, I was subclassing 'SemanticSegmentationDataReader' and I've have forgotten to divide the labels by 255. This case is diferente. I'm not subclassing. What can be the problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Check the values in your labels to see what the problem is. x, y = train_ds[0]
print(y.unique()) |
Beta Was this translation helpful? Give feedback.
-
Thank you, very much! |
Beta Was this translation helpful? Give feedback.
The 255 you were seeing before wasn't because you were subclassing, but rather because your label files were pre-chipped RGB images with pixel values in the range 0-255.
In the present case, the labels are not pre-chipped and are single-band but still 0-255. Since we are reading them via a
RasterSource
, we can take advantage of theReclassTransformer
: