Ssd.pytorch: One problem of demo.py with my dataset

Created on 13 May 2019  路  2Comments  路  Source: amdegroot/ssd.pytorch

when I use my trained model in the demo.py, it has the error:

RuntimeError: Error(s) in loading state_dict for SSD:
size mismatch for conf.0.weight: copying a param with shape torch.Size([8, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([84, 512, 3, 3]).
size mismatch for conf.0.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([84]).
size mismatch for conf.1.weight: copying a param with shape torch.Size([12, 1024, 3, 3]) from checkpoint, the shape in current model is torch.Size([126, 1024, 3, 3]).
size mismatch for conf.1.bias: copying a param with shape torch.Size([12]) from checkpoint, the shape in current model is torch.Size([126]).
size mismatch for conf.2.weight: copying a param with shape torch.Size([12, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([126, 512, 3, 3]).
size mismatch for conf.2.bias: copying a param with shape torch.Size([12]) from checkpoint, the shape in current model is torch.Size([126]).
size mismatch for conf.3.weight: copying a param with shape torch.Size([12, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([126, 256, 3, 3]).
size mismatch for conf.3.bias: copying a param with shape torch.Size([12]) from checkpoint, the shape in current model is torch.Size([126]).
size mismatch for conf.4.weight: copying a param with shape torch.Size([8, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([84, 256, 3, 3]).
size mismatch for conf.4.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([84]).
size mismatch for conf.5.weight: copying a param with shape torch.Size([8, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([84, 256, 3, 3]).
size mismatch for conf.5.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current mode

Do you know how to fix it?

Most helpful comment

Have fixed: net = build_ssd('test', 300, 2) # initialize SSD

All 2 comments

Have fixed: net = build_ssd('test', 300, 2) # initialize SSD

@sxyxf66 I am having the same issue. Could you please help me with what to do to avoid it? I am not quite understanding what you mean with the comment on your fix.

IMG_20200819_171047

I am using this https://github.com/dusty-nv/jetson-inference.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kouyichi picture kouyichi  路  5Comments

JingpengSun picture JingpengSun  路  4Comments

sxyxf66 picture sxyxf66  路  4Comments

FostorHUNT picture FostorHUNT  路  4Comments

DHZS picture DHZS  路  5Comments