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

IndexError #1

Open
DK223 opened this issue Oct 29, 2020 · 1 comment
Open

IndexError #1

DK223 opened this issue Oct 29, 2020 · 1 comment

Comments

@DK223
Copy link

DK223 commented Oct 29, 2020

Traceback (most recent call last):
File "train.py", line 100, in
main(parse_args())
File "train.py", line 57, in main
loss, miou = net(img, label)
File "/home/wdk/.conda/envs/farseg/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/wdk/FarSeg/FarSeg/models/farnet.py", line 68, in forward
return self._get_loss(logit, label), self._get_miou(logit, label)
File "/home/wdk/FarSeg/FarSeg/models/farnet.py", line 90, in _get_loss
logit, label = logit[mask], label[mask]
IndexError: The shape of the mask [4816896] at index 0 does not match the shape of the indexed tensor [1605632, 7] at index 0

Hi, I meet the Error when I run the code on ISAID dataset, the batch is set as default.
And I couldn't start training because of this.
So, is there something wrong with the shape of the label or the logit, or the number of the class, or something else?
Please Give me some help, thanks!

@DK223
Copy link
Author

DK223 commented Oct 29, 2020

I found that maybe there is something wrong when I preprocess data.
Would please tell me How you Preprocess the json in the dataset? Do you convert it to the graylabel Image? what do you put into the label_folder?

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

No branches or pull requests

1 participant