pengzhiliang / MAE-pytorch

Unofficial PyTorch implementation of Masked Autoencoders Are Scalable Vision Learners
2.6k stars 342 forks source link

fine tune to segmentation model not match #55

Closed Rui-Zhou-2 closed 2 years ago

Rui-Zhou-2 commented 2 years ago

Hi, since BEIT has decoder for segmentaion task, then I want to change MAE as backbone with your pretrained model,

but I got some errors: The model and loaded state dict do not match exactly unexpected key in source state_dict: mask_token, encoder.patch_embed.proj.weight, encoder.patch_embed.proj.bias, encoder.blocks.0.norm1.weight,.... WARNING:mmseg:The model and loaded state dict do not match exactly unexpected key in source state_dict: mask_token, encoder.patch_embed.proj.weight, encoder.patch_embed.proj.bias, encoder.blocks.0.norm1.weight,.. load model from: /opt/meituan/cephfs/user/hadoop-basecv/zhourui/pretrain_mae_vit_base_mask_0.75_400e.pth

it seems that the decoder can not match when the backbone change, could you give me some suggestions?

With great appreciation

pengzhiliang commented 2 years ago

Thanks for your work.

Maybe you can implement a map function that changes the key name according to your demand.

zsddd commented 2 years ago

嗨,由于BEIT具有用于分段任务的解码器,因此我想将MAE更改为具有预训练模型的主干,

但我得到了一些错误: The model and loaded state dict do not match exactly unexpected key in source state_dict: mask_token, encoder.patch_embed.proj.weight, encoder.patch_embed.proj.bias, encoder.blocks.0.norm1.weight,.... WARNING:mmseg:The model and loaded state dict do not match exactly unexpected key in source state_dict: mask_token, encoder.patch_embed.proj.weight, encoder.patch_embed.proj.bias, encoder.blocks.0.norm1.weight,.. load model from: /opt/meituan/cephfs/user/hadoop-basecv/zhourui/pretrain_mae_vit_base_mask_0.75_400e.pth

似乎解码器无法匹配当骨干改变时,你能给我一些建议吗?

非常感谢

你好 请问分割任务实现了吗?可够提供下代码,有偿 十分感谢

xiangtaowong commented 2 years ago

嗨,由于BEIT具有用于分段任务的解码器,因此我想将MAE更改为具有预训练模型的主干, 但我得到了一些错误: The model and loaded state dict do not match exactly unexpected key in source state_dict: mask_token, encoder.patch_embed.proj.weight, encoder.patch_embed.proj.bias, encoder.blocks.0.norm1.weight,.... WARNING:mmseg:The model and loaded state dict do not match exactly unexpected key in source state_dict: mask_token, encoder.patch_embed.proj.weight, encoder.patch_embed.proj.bias, encoder.blocks.0.norm1.weight,.. load model from: /opt/meituan/cephfs/user/hadoop-basecv/zhourui/pretrain_mae_vit_base_mask_0.75_400e.pth 似乎解码器无法匹配当骨干改变时,你能给我一些建议吗? 非常感谢

你好 请问分割任务实现了吗?可够提供下代码,有偿 十分感谢

你好 请问分割任务实现了吗?可够提供下代码,有偿 十分感谢