New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问这个报错:AttributeError: 'EfficientFormerClsHead' object has no attribute 'post_process',没有post_process()方法? #93
Comments
报错信息帖完整~ |
Loading D:\PyProj\pretrain\efficientformer-l3_3rdparty_in1k_20220803-dde1c8c5.pth size mismatch for head.head.weight: copying a param with shape torch.Size([1000, 512]) from checkpoint, the shape in current model is torch.Size([4, 512]). missing keys in source state_dict: backbone.network.1.0.conv.weight, backbone.network.1.0.conv.bias, backbone.network.1.0.bn.weight, backbone.network.1.0.bn.bias, backbone.network.1.0.bn.running_mean, backbone.network.1.0.bn.running_var, backbone.network.2.0.conv.weight, backbone.network.2.0.conv.bias, backbone.network.2.0.bn.weight, backbone.network.2.0.bn.bias, backbone.network.2.0.bn.running_mean, backbone.network.2.0.bn.running_var, backbone.network.3.0.conv.weight, backbone.network.3.0.conv.bias, backbone.network.3.0.bn.weight, backbone.network.3.0.bn.bias, backbone.network.3.0.bn.running_mean, backbone.network.3.0.bn.running_var Train: Epoch 1/100: 0%| | 0/651 [00:14<?, ?it/s<class 'dict'>] |
请问为什么一开始模型就匹配不上? |
因为你的分类是4类而预训练模型是1000类,分类头肯定是不匹配的,可以理解为此处加载预训练模型更多的用他的backbone而重训分类头 |
刚开始接触不太明白,请问一下我尝试其他模型的时候用LinearClsHead这个分类头,我numclass也是直接改成4的,为什么这个分类头是可以直接匹配的? |
你改了结构当然权重匹配不上啊 |
No description provided.
The text was updated successfully, but these errors were encountered: