amdegroot / ssd.pytorch

A PyTorch Implementation of Single Shot MultiBox Detector
MIT License
5.11k stars 1.74k forks source link

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

Open sujeet764 opened 4 years ago

sujeet764 commented 4 years ago

/home/cya/git_clones/ssd.pytorch/ssd.py:34: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead. self.priors = Variable(self.priorbox.forward(), volatile=True) /home/cya/gitclones/ssd.pytorch/layers/modules/l2norm.py:17: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant. init.constant(self.weight,self.gamma) [INFO] starting threaded video stream... Traceback (most recent call last): File "demo/live.py", line 82, in cv2_demo(net.eval(), transform) File "demo/live.py", line 55, in cv2_demo frame = predict(frame) File "demo/live.py", line 25, in predict y = net(x) # forward pass File "/home/cya/anaconda3/envs/tensorflow/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, **kwargs) File "/home/cya/git_clones/ssd.pytorch/ssd.py", line 103, in forward self.priors.type(type(x.data)) # default boxes File "/home/cya/git_clones/ssd.pytorch/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)

gjxgjxgjxgjx commented 4 years ago

函数返回的值不够

soongjian commented 4 years ago

detection.py
line 49 indtead "if scores.dim() == 0:" with " if scores.size(0)==0:"