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

请问以下问题改怎么解决? #83

Open
DaWenxi777 opened this issue Mar 9, 2024 · 0 comments
Open

请问以下问题改怎么解决? #83

DaWenxi777 opened this issue Mar 9, 2024 · 0 comments

Comments

@DaWenxi777
Copy link

Traceback (most recent call last):
File "/home/hipeson/ljh/A-pidnet-main/tools/train.py", line 218, in
main()
File "/home/hipeson/ljh/A-pidnet-main/tools/train.py", line 180, in main
train(config, epoch, config.TRAIN.END_EPOCH,
File "/home/hipeson/ljh/A-pidnet-main/tools/../utils/function.py", line 43, in train
losses, _, acc, loss_list = model(images, labels, bd_gts)
File "/home/hipeson/anaconda3/envs/myopenmmlab/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/hipeson/anaconda3/envs/myopenmmlab/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 165, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/hipeson/anaconda3/envs/myopenmmlab/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/hipeson/ljh/A-pidnet-main/tools/../utils/utils.py", line 50, in forward
loss_b = self.bd_loss(outputs[-1], bd_gt)
File "/home/hipeson/anaconda3/envs/myopenmmlab/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/hipeson/ljh/A-pidnet-main/tools/../utils/criterion.py", line 129, in forward
bce_loss = self.coeff_bce * weighted_bce(bd_pre, bd_gt)
File "/home/hipeson/ljh/A-pidnet-main/tools/../utils/criterion.py", line 114, in weighted_bce
weight[pos_index] = neg_num * 1.0 / sum_num
IndexError: The shape of the mask [1, 6] at index 1 does not match the shape of the indexed tensor [1, 524288] at index 1

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