Sense-X / UniFormer

[ICLR2022] official implementation of UniFormer
Apache License 2.0
828 stars 111 forks source link

语义分割时,单卡预训练权重加载 #70

Closed creater-zq closed 2 years ago

creater-zq commented 2 years ago

您好!我使用upernet_uniformer做语义分割,只使用了一个GPU。

missing keys in source state_dict: norm1.weight, norm1.bias, norm2.weight, norm2.bias, norm3.weight, norm3.bias, norm4.weight, norm4.bias


* 使用预训练权重`uniformer_base_ls_in1k.pth`时,加载出现如下错误:
```bash
unexpected key in source state_dict: norm.weight, norm.bias, norm.running_mean, norm.running_var, norm.num_batches_tracked, head.weight, head.bias, blocks3.0.gamma_1, blocks3.0.gamma_2, blocks3.1.gamma_1, blocks3.1.gamma_2, blocks3.2.gamma_1, blocks3.2.gamma_2, blocks3.3.gamma_1, blocks3.3.gamma_2, blocks3.4.gamma_1, blocks3.4.gamma_2, blocks3.5.gamma_1, blocks3.5.gamma_2, blocks3.6.gamma_1, blocks3.6.gamma_2, blocks3.7.gamma_1, blocks3.7.gamma_2, blocks3.8.gamma_1, blocks3.8.gamma_2, blocks3.9.gamma_1, blocks3.9.gamma_2, blocks3.10.gamma_1, blocks3.10.gamma_2, blocks3.11.gamma_1, blocks3.11.gamma_2, blocks3.12.gamma_1, blocks3.12.gamma_2, blocks3.13.gamma_1, blocks3.13.gamma_2, blocks3.14.gamma_1, blocks3.14.gamma_2, blocks3.15.gamma_1, blocks3.15.gamma_2, blocks3.16.gamma_1, blocks3.16.gamma_2, blocks3.17.gamma_1, blocks3.17.gamma_2, blocks3.18.gamma_1, blocks3.18.gamma_2, blocks3.19.gamma_1, blocks3.19.gamma_2, blocks4.0.gamma_1, blocks4.0.gamma_2, blocks4.1.gamma_1, blocks4.1.gamma_2, blocks4.2.gamma_1, blocks4.2.gamma_2, blocks4.3.gamma_1, blocks4.3.gamma_2, blocks4.4.gamma_1, blocks4.4.gamma_2, blocks4.5.gamma_1, blocks4.5.gamma_2, blocks4.6.gamma_1, blocks4.6.gamma_2

missing keys in source state_dict: norm1.weight, norm1.bias, norm2.weight, norm2.bias, norm3.weight, norm3.bias, norm4.weight, norm4.bias
Andy1621 commented 2 years ago

It's normal to print this error because of the difference between the backbones of pre-training and downstream tasks. However, this is just a warning as the strict=False: https://github.com/SwinTransformer/Swin-Transformer-Object-Detection/blob/a90acdda2156c93a447e16a2fd8befc63bd534de/mmcv_custom/checkpoint.py#L97-L106

creater-zq commented 2 years ago

哦哦哦,也就是不用管,直接train就完事了