在给yolov7加Senet注意力机制练习的时候,遇到了在train之后,getmap出现了报错
RuntimeError: Error(s) in loading state_dict for YoloBody:
Missing key(s) in state_dict: "feat1_att.fc.0.weight", "feat1_att.fc.2.weight", "feat2_att.fc.0.weight", "feat2_att.fc.2.weight", "feat3_att.fc.0.weight", "feat3_att.fc.2.weight", "upsample_att1.fc.0.weight", "upsample_att1.fc.2.weight", "upsample_att2.fc.0.weight", "upsample_att2.fc.2.weight".
然后我就去打印模型和state_dict,结果注意力模块在相应的位置和state_dict中都有,我在想是不是训练模型中最终保存的权值不存在相对应权值,我就把pth文件打开看了一下,果然没有注意力模块的权值。想问一下为什么