-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
This is because of what #327
Comments
having the same problem here. |
I have the same problem. Have you solved it? |
I changed the code the following way, seems working fine for me. @@ -95,8 +95,8 @@ class MultiBoxLoss(nn.Module):
loss_c = log_sum_exp(batch_conf) - batch_conf.gather(1, conf_t.view(-1, 1))
# Hard Negative Mining
- loss_c[pos] = 0 # filter out pos boxes for now
loss_c = loss_c.view(num, -1)
+ loss_c[pos] = 0 # filter out pos boxes for now
_, loss_idx = loss_c.sort(1, descending=True)
_, idx_rank = loss_idx.sort(1)
num_pos = pos.long().sum(1, keepdim=True) |
it works fine for me too. But I meet another problem, Loss keeps NAN |
Same problem here. Maybe we're doing something else wrong that causes the error in the first place? Moving the |
I was able to fix my nan issue. My solution: #173 (comment) |
Traceback (most recent call last):
File "train.py", line 275, in
train()
File "train.py", line 198, in train
loss_l, loss_c = criterion(out, targets)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/qiuyj/SSD/layers/modules/multibox_loss.py", line 101, in forward
loss_c[pos] = 0 # filter out pos boxes for now
RuntimeError: The shape of the mask [1, 8732] at index 0 does not match the shape of the indexed tensor [8732, 1] at index 0
use VOC dataset
`
The text was updated successfully, but these errors were encountered: