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

我下载了 Oil-Polution-Dataset,运行代码时报错了。 #1

Open
aitangbodan opened this issue May 9, 2023 · 1 comment
Open

Comments

@aitangbodan
Copy link

=> creating log/oilpollution/pidnet_small/pidnet_small_oil_raw_2023-05-09-14-46
<class 'datasets.elanroad.ElanRoad'>
Epoch: [1/175] Iter:[5/169], lr: ['0.009999'], Loss: 145.18, Acc:0.00, Semantic loss:
Traceback (most recent call last):
File "tools/train.py", line 221, in
main()
File "tools/train.py", line 184, in main
train(config, epoch, config.TRAIN.END_EPOCH,
File "/home/Oil-Polution-Dataset-with-PIDNet/tools/../utils/function.py", line 42, in train
losses, _, acc, loss_list = model(images, labels, bd_gts)
File "/home/.conda/envs/pytorch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/.conda/envs/pytorch/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 169, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/.conda/envs/pytorch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/Oil-Polution-Dataset-with-PIDNet/tools/../utils/utils.py", line 54, in forward
loss_sb = self.sem_loss(outputs[-2], bd_label)
File "/home/.conda/envs/pytorch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/Oil-Polution-Dataset-with-PIDNet/tools/../utils/criterion.py", line 105, in forward
return sb_weights * self._ohem_forward(score[0], target)
File "/home/Oil-Polution-Dataset-with-PIDNet/tools/../utils/criterion.py", line 81, in _ohem_forward
min_value = pred[min(self.min_kept, pred.numel() - 1)]
IndexError: index -1 is out of bounds for dimension 0 with size 0

@snachi2s
Copy link

snachi2s commented Apr 9, 2024

Try changing the BASE_SIZE parameter in config file.
It solves the error mostly!!

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

2 participants