quic / aimet-model-zoo

Other
293 stars 53 forks source link

SESR model cards have incorrect parameters for the corresponding weights files #51

Open dmckinnon opened 7 months ago

dmckinnon commented 7 months ago

if you look at ⁠sesr_m3 x4 config in aimet zoo (and maybe other sesr variants), it says scaling_factor = 2, num_lblocks = 4.

When I load the fp32 weights file provided in that config, it complains thus

RuntimeError: Error(s) in loading state_dict for SESRRelease:
        Missing key(s) in state_dict: "residual_block.3.conv_expand.weight", "residual_block.3.conv_squeeze.weight", "residual_block.3.conv_squeeze.bias". 
        size mismatch for anchor.net.weight: copying a param with shape torch.Size([48, 3, 1, 1]) from checkpoint, the shape in current model is torch.Size([12, 3, 1, 1]).
        size mismatch for anchor.net.bias: copying a param with shape torch.Size([48]) from checkpoint, the shape in current model is torch.Size([12]).
        size mismatch for conv_last.conv_squeeze.weight: copying a param with shape torch.Size([48, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([12, 256, 1, 1]).
        size mismatch for conv_last.conv_squeeze.bias: copying a param with shape torch.Size([48]) from checkpoint, the shape in current model is torch.Size([12]).

⁠When I make scaling factor 4 (since the params have size 48), num_lblocks 3 (since you can see in the model that there are 3 sets of residual blocks), it accepts everything just fine.

quic-mangal commented 7 months ago

@dmckinnon, thanks for pointing it out. Would you like to create a PR for this to make the change? Thanks