AILab-CVC / UniRepLKNet

[CVPR'24] UniRepLKNet: A Universal Perception Large-Kernel ConvNet for Audio, Video, Point Cloud, Time-Series and Image Recognition
https://arxiv.org/abs/2311.15599
Apache License 2.0
863 stars 52 forks source link

The parameter loading is incomplete #3

Closed Manningchan closed 6 months ago

Manningchan commented 7 months ago

i use the unireplknet-s model to train my dataset and save a pth, but when i use the reparameterize.py or pytorch2onnx.py all occured the same false patameters 2023-12-02 15:19:52,935 - mmseg - WARNING - unexpected key in source state_dict: norm.weight, norm.bias, head.weight, head.bias

missing keys in source state_dict: stages.2.16.dwconv.bias, stages.2.26.dwconv.bias, stages.2.2.dwconv.bias, stages.2.5.dwconv.bias, stages.2.10.dwconv.bias, stages.2.4.dwconv.bias, stages.2.14.dwconv.bias, stages.2.8.dwconv.bias, stages.2.13.dwconv.bias, stages.2.19.dwconv.bias, stages.0.1.dwconv.bias, stages.2.23.dwconv.bias, stages.2.7.dwconv.bias, stages.2.20.dwconv.bias, stages.2.22.dwconv.bias, stages.0.2.dwconv.bias, stages.2.17.dwconv.bias, stages.0.0.dwconv.bias, stages.2.11.dwconv.bias, stages.2.1.dwconv.bias, stages.2.25.dwconv.bias

DingXiaoH commented 7 months ago

Yes it is a bug. Thank you for pointing it out. I have fixed it (see this commit https://github.com/AILab-CVC/UniRepLKNet/commit/5349bcee9a8202c62c8c169220f8cc613914baac).

DingXiaoH commented 7 months ago

Getting "unexpected key in source state_dict: norm.weight, norm.bias, head.weight, head.bias" is because your constructed model has no imagenet-classification head which comprises a norm and a linear layer. The missing keys are due to the bug (the training model should not have dwconv.bias).