lightDSFD icon indicating copy to clipboard operation
lightDSFD copied to clipboard

ValueError: not enough values to unpack (expected 2, got 0)

Open colorjam opened this issue 4 years ago • 3 comments

Hi, thank you for sharing the code. When I run test.py with light_test_widerface(), I get the following error:

Traceback (most recent call last):
  File "test.py", line 215, in <module>
    light_test_widerface()
  File "test.py", line 207, in light_test_widerface
    det = infer(net , img , transform , thresh , cuda , shrink)
  File "test.py", line 98, in infer
    y = net(x)      # forward pass
  File "/home/v-chenqy/.pyenv/versions/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/v-chenqy/Repo/lightDSFD/light_face_ssd.py", line 333, in forward
    self.priors.type(type(x.data))                 # default boxes
  File "/home/v-chenqy/Repo/lightDSFD/layers/functions/detection.py", line 76, in forward
    ids, count = nms(boxes, scores, self.nms_thresh, self.top_k)
ValueError: not enough values to unpack (expected 2, got 0)

colorjam avatar May 20 '20 14:05 colorjam

i have the same question.

xinzi2018 avatar Jul 02 '20 08:07 xinzi2018

原因是检测的结果为空,就是boxes是空的,需要添加一个判断

swordlidev avatar Jul 02 '20 08:07 swordlidev

谢谢 已解决

xinzi2018 avatar Jul 03 '20 05:07 xinzi2018