Skip to content

Pretrained Model Architecture Mismatch and Training Errors in SparseMat #14

@ztMotaLee

Description

@ztMotaLee

Hello Thank you for your wonderful work on Image Matting! I encountered some problems when testing the pretrained model: It seems that the pretrained model you provided does not match the shape of the network, for example:

...
RuntimeError: Error(s) in loading state_dict for SparseMat:
size mismatch for shm.backbone.conv1.weight: copying a param with shape torch.Size([3, 3, 4, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 4]).

At the same time, when I tried to retrain the model, I encountered the following problems:
...
SparseMat-main/model/backbones/sparse_resnet_bn.py", line 61, in forward
out = self.conv1(x)
...
AssertionError: channel size mismatch.

Could you please check the code carefully or provide a corrected version? Thank you very much for your attention to these matters and for your dedication to open-source development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions