1. 程式人生 > >SSD pytorch 原始碼demo報錯: ValueError: not enough values to unpack (expected 2, got 0)

SSD pytorch 原始碼demo報錯: ValueError: not enough values to unpack (expected 2, got 0)

https://github.com/amdegroot/ssd.pytorch/issues/154#issuecomment-384856547

detection.py 檔案中第49行(行數可以因版本不同而不同):

if scores.dim() == 0:
    continue

改為

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