# Solvedssd.pytorch ValueError: not enough values to unpack (expected 2, got 0)

## ✔️Accepted Answer

I changed the code as follows and worked for me.

In detection.py of line 62

from

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

to

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

## Other Answers:

if dets.dim() == 1

to

if dets.size(0) == 1

After I change the code , it turns out to be

File "eval.py", line 438, in

thresh=args.confidence_threshold)

File "eval.py", line 395, in test_net

boxes = dets[:, 1:]

IndexError: too many indices for tensor of dimension 1

How can I solve it?

I changed the code as follows and worked for me.

In detection.py of line 62

fromif scores.dim() == 0: continueto

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

Excuse me, I changed the demo of 'if scores.dim() == 0:' to 'if scores.size(0) == 0:', but still got the error that ValueError: not enough values to unpack (expected 2, got 0). I am using pytorch=0.4.0, The error will miss if I install a version of 0.3.1. Can you help me with that? Thanks a lot

Thanks. @mkx1925 @ivansong1988 I am using pytorch=0.4.0. And your answers help me out.

Hello,sir. Did your test the demo successly in the version of 0.4.0? Did you changed other place? I got the same error and thy to solve it by changing the demo of 'if scores.dim() == 0:' to 'if scores.size(0) == 0:' ,but failed. Can you help me with that please? Thanks a lot.

just the same question, you can restart jupyter notebook to run again , then its work.

I am getting error when I try to use the pretrained model:

`python demo/live.py --weights ./weights/ssd300_mAP_77.43_v2.pth`