Problem with number of classes #1750
-
Hi again, The dataset on has background and buildings, therefore I have this class definition:
This is my task:
And this is my training configuration:
When I train:
I get:
How can I solve this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
We already have a builtin dataset and data module for Inria Aerial Image Labeling. Have you tried using that? It's tested in CI so it's guaranteed to work. The error message implies to me that the file you are reading contains values larger than 1, so even though there are two classes, the classes aren't 0 or 1. Hopefully that helps with debugging. |
Beta Was this translation helpful? Give feedback.
-
I'm using it as a custom dataset (found in Kaggle) because I'm making a comparative study between Torchgeo and Rastervision with my students. I already showed them how to use a custom dataset on RV and now I'm trying to show them how to perform the same work on TG. The idea is to use our on custom dataset later. How can I reclass my masks using a custom RasterDataset?
|
Beta Was this translation helpful? Give feedback.
-
Good to know about #1742 . Thanks for this info. Regarding the reclassification. I would like to use a transform (considering that was needed in RV as well, so it would be a good parallel). Through a How would be this reclass transform? |
Beta Was this translation helpful? Give feedback.
-
It works fine! Thank you very much! |
Beta Was this translation helpful? Give feedback.
If you use a dataset transform, it will take in a dict and return a dict, so you decide which dict keys are affected. Something as simple as:
should work, but I haven't tested it.
If you use a data module augmentation, those are designed to use Kornia augmentations, so the syntax will be pretty different.