Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion t >= 0 && t < n_classes in Chesapeake13 #1439

Closed
patriksabol opened this issue Jun 21, 2023 · 5 comments
Closed

Assertion t >= 0 && t < n_classes in Chesapeake13 #1439

patriksabol opened this issue Jun 21, 2023 · 5 comments
Assignees
Labels
datasets Geospatial or benchmark datasets

Comments

@patriksabol
Copy link

patriksabol commented Jun 21, 2023

Description

When training on Chesapeake13 with num_classes=14 and ignore_index=0, an assertion error ‘t >= 0 && t < n_classes’ occurs. This indicates that there are more class indices in the Chesapeake label imagery than the specified num_classes. However, when running gdalinfo Baywide_13Class_20132014.tif Min=1.000 Max=12.000 Minimum=1.000, Maximum=12.000,

Could there be a problem with computing indices from Chesapeake13? I am using RandomBatchGeoSampler, so this error could randomly appear when there is a patch with a false class ID.”

Steps to reproduce

Training on Chesaspeake13

Version

0.4.1

@adamjstewart
Copy link
Collaborator

I also noticed this here: #1368 (comment)

@calebrob6 can you look into this?

@adamjstewart adamjstewart added the datasets Geospatial or benchmark datasets label Jun 21, 2023
@adamjstewart adamjstewart added this to the 0.4.2 milestone Jun 21, 2023
@calebrob6
Copy link
Member

Sure

@adamjstewart
Copy link
Collaborator

Any luck @calebrob6?

@adamjstewart adamjstewart removed this from the 0.4.2 milestone Sep 28, 2023
@adamjstewart
Copy link
Collaborator

Note that Chesapeake13 no longer exists after #2214, but the question still applies for the remaining Chesapeake state-specific products.

@calebrob6
Copy link
Member

calebrob6 commented Sep 4, 2024

t >= 0 && t < n_classes means that CrossEntropy is seeing class indices in your mask that are less than 0 or greater than number of classes - 1.

To actually use the new Chesapeake state-specific products in training the user will need to re-map the masks to the range [0, num_classes - 1]. @adamjstewart -- this probably should be a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets
Projects
None yet
Development

No branches or pull requests

3 participants