Object-Detection-SSD icon indicating copy to clipboard operation
Object-Detection-SSD copied to clipboard

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

Open codehax41 opened this issue 5 years ago • 1 comments


ValueError Traceback (most recent call last) in 4 writer = imageio.get_writer('output.mp4', fps = fps) 5 for i, frame in enumerate(reader): ----> 6 frame = detect(frame, net.eval(), transform) 7 writer.append_data(frame) 8 print(i)

in detect(frame, net, transform) 5 x = torch.from_numpy(frame_t).permute(2, 0, 1) #green red blue 6 x = Variable(x.unsqueeze(0)) ----> 7 y = net(x) 8 detections = y.data 9 scale = torch.Tensor([width, height, width, height])

~\Anaconda3\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs) 487 result = self._slow_forward(*input, **kwargs) 488 else: --> 489 result = self.forward(*input, **kwargs) 490 for hook in self._forward_hooks.values(): 491 hook_result = hook(self, input, result)

~\OpenCV Intermediate\Module 2 - Object Detection\ssd.py in forward(self, x) 99 loc.view(loc.size(0), -1, 4), # loc preds 100 self.softmax(conf.view(-1, self.num_classes)), # conf preds --> 101 self.priors.type(type(x.data)) # default boxes 102 ) 103 else:

~\OpenCV Intermediate\Module 2 - Object Detection\layers\functions\detection.py in forward(self, loc_data, conf_data, prior_data) 61 boxes = decoded_boxes[l_mask].view(-1, 4) 62 # idx of highest scoring and non-overlapping boxes per class ---> 63 ids, count = nms(boxes, scores, self.nms_thresh, self.top_k) 64 self.output[i, cl, :count] =
65 torch.cat((scores[ids[:count]].unsqueeze(1),

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

codehax41 avatar Apr 28 '19 13:04 codehax41