bailvwangzi / repulsion_loss_ssd

Repulsion Loss: Detecting Pedestrians in a Crowd. https://arxiv.org/abs/1711.07752
MIT License
234 stars 66 forks source link

demo issue #9

Open buptzqr opened 5 years ago

buptzqr commented 5 years ago

when I run the demo, I got a error,please help me,thank you.

the error information as following: y = net(xx) File "/home/bupt-sse3/anaconda3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/home/bupt-sse3/repulsion_loss_ssd-master/ssd.py", line 103, in forward self.priors.type(type(x.data)) # default boxes File "/home/bupt-sse3/repulsion_loss_ssd-master/layers/functions/detection.py", line 54, in forward ids, count = nms(boxes, scores, self.nms_thresh, self.top_k) ValueError: not enough values to unpack (expected 2, got 0)

ghost commented 5 years ago

i got the same result.

ghost commented 5 years ago

I changed the code as follows and worked for me. In detection.py of line 49 from

if scores.dim() == 0: continue to

if scores.size(0) == 0: continue