torchgeo icon indicating copy to clipboard operation
torchgeo copied to clipboard

Assertion `t >= 0 && t < n_classes` in Chesapeake13

Open patriksabol opened this issue 2 years ago • 4 comments

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

patriksabol avatar Jun 21 '23 14:06 patriksabol

I also noticed this here: https://github.com/microsoft/torchgeo/pull/1368#issuecomment-1565705950

@calebrob6 can you look into this?

adamjstewart avatar Jun 21 '23 15:06 adamjstewart

Sure

calebrob6 avatar Jun 22 '23 16:06 calebrob6

Any luck @calebrob6?

adamjstewart avatar Sep 06 '23 20:09 adamjstewart