pytorch-ssd icon indicating copy to clipboard operation
pytorch-ssd copied to clipboard

run problem

Open qintaohu opened this issue 6 years ago • 1 comments

sorry, i cloned your code and ran test.py , but i got the problem

Finished loading model! Testing image 1/4952.... /home/hqt/PycharmProjects/pytorch-ssd-master/ssd.py:101: UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. self.softmax(conf.view(-1, self.num_classes)), # conf preds Traceback (most recent call last): File "/home/hqt/PycharmProjects/pytorch-ssd-master/test.py", line 91, in thresh=args.visual_threshold) File "/home/hqt/PycharmProjects/pytorch-ssd-master/test.py", line 52, in test_net y = net(x) # forward pass File "/home/hqt/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/home/hqt/PycharmProjects/pytorch-ssd-master/ssd.py", line 102, in forward self.priors.type(type(x.data)) # default boxes File "/home/hqt/PycharmProjects/pytorch-ssd-master/layers/functions/detection.py", line 61, in forward ids, count = nms(boxes, scores, self.nms_thresh, self.top_k) ValueError: not enough values to unpack (expected 2, got 0)

but i ran train.py ,i got this message: File "/home/hqt/PycharmProjects/pytorch-ssd-master/train.py", line 257, in train() File "/home/hqt/PycharmProjects/pytorch-ssd-master/train.py", line 204, in train loss_l, loss_c = criterion(out, targets) File "/home/hqt/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/home/hqt/PycharmProjects/pytorch-ssd-master/layers/modules/multibox_loss.py", line 98, in forward loss_c[pos] = 0 # filter out pos boxes for now RuntimeError: The shape of the mask [16, 24564] at index 0 does not match the shape of the indexed tensor [393024, 1] at index 0

so ,could you help me solve this problem, thank you!

qintaohu avatar Nov 24 '18 06:11 qintaohu

I think your pytorch-version is 0.4, please try 0.3

d049 avatar Dec 03 '18 08:12 d049