sander-ali / Sematic_Segmentation_With_SegFormer

The code uses SegFormer for Semantic Segmentation on Drone Dataset.
1 stars 0 forks source link

Segformer: Index 29 is out of bounds #1

Open chris-kehl opened 2 years ago

chris-kehl commented 2 years ago

File "/data/users/me/segformer.py", line 109, in out = mdl(pixel_values = pval, labels = gt) File "/data/users/christopher.kehl/.miniconda/envs/pytorch/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/data/users/christopher.kehl/.miniconda/envs/pytorch/lib/python3.9/site-packages/transformers/models/segformer/modeling_segformer.py", line 809, in forward loss = loss_fct(upsampled_logits, labels) File "/data/users/christopher.kehl/.miniconda/envs/pytorch/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, **kwargs) File "/data/users/christopher.kehl/.miniconda/envs/pytorch/lib/python3.9/site-packages/torch/nn/modules/loss.py", line 1150, in forward return F.cross_entropy(input, target, weight=self.weight, File "/data/users/christopher.kehl/.miniconda/envs/pytorch/lib/python3.9/site-packages/torch/nn/functional.py", line 2846, in cross_entropy return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) IndexError: Target 29 is out of bounds.

leonard-cooper commented 2 years ago

hello, i alse meet this problem have you solved that problem?

chris-kehl commented 2 years ago

I have not solved this problem as of yet. I have the question submitted to stackoverflow https://stackoverflow.com/questions/72106956/segformer-indexerror-target-151-is-out-of-bounds#comment127477990_72106956 I am running this on an HPC, I may recreate on colab to share and see if I can share from there.

sander-ali commented 2 years ago

What is the number of classes?

chris-kehl commented 2 years ago

25 classes 0-24

chris-kehl commented 2 years ago

25

Best Regards, Chris Kehl

On May 9, 2022, at 15:51, Dr. Sander Ali Khowaja @.***> wrote:

 What are the number of classes?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.