Jaraxxus-Me / PVT_pp

Full conference version of PVT++: A Simple End-to-End Latency-Aware Visual Tracking Framework
https://jaraxxus-me.github.io/ICCV2023_PVTpp/
38 stars 5 forks source link

Missing key(s) in state_dict #4

Closed ParaImage closed 1 year ago

ParaImage commented 1 year ago

I've tried demo.py script withexperiments/siamrpn_mobilev2_l234_dwxcorr/pre_mv_config.yaml and my_models/RPN_Mob_MV.pth but this exception rised:

raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for ModelBuilder:
    Missing key(s) in state_dict: "backbone.layer0.0.weight", "backbone.layer0.1.weight", "backbone.layer0.1.bias", "backbone.layer0.1.running_mean", "backbone.layer0.1.running_var", "backbone.layer1.0.conv.0.weight", "backbone.layer1.0.conv.1.weight", "backbone.layer1.0.conv.1.bias", "backbone.layer1.0.conv.1.running_mean", "backbone.layer1.0.conv.1.running_var", "backbone.layer1.0.conv.3.weight", "backbone.layer1.0.conv.4.weight", "backbone.layer1.0.conv.4.bias", "backbone.layer1.0.conv.4.running_mean", "backbone.layer1.0.conv.4.running_var", "backbone.layer1.0.conv.6.weight", "backbone.layer1.0.conv.7.weight", "backbone.layer1.0.conv.7.bias", "backbone.layer1.0.conv.7.running_mean", "backbone.layer1.0.conv.7.running_var", "backbone.layer2.0.conv.0.weight", "backbone.layer2.0.conv.1.weight", "backbone.layer2.0.conv.1.bias", "backbone.layer2.0.conv.1.running_mean", "backbone.layer2.0.conv.1.running_var", "backbone.layer2.0.conv.3.weight", "backbone.layer2.0.conv.4.weight", "backbone.layer2.0.conv.4.bias", "backbone.layer2.0.conv.4.running_mean", "backbone.layer2.0.conv.4.running_var", "backbone.layer2.0.conv.6.weight", "backbone.layer2.0.conv.7.weight", "backbone.layer2.0.conv.7.bias", "backbone.layer2.0.conv.7.running_mean", "backbone.layer2.0.conv.7.running_var", "backbone.layer2.1.conv.0.weight", "backbone.layer2.1.conv.1.weight", "backbone.layer2.1.conv.1.bias", "backbone.layer2.1.conv.1.running_mean", "backbone.layer2.1.conv.1.running_var", "backbone.layer2.1.conv.3.weight", "backbone.layer2.1.conv.4.weight", "backbone.layer2.1.conv.4.bias", "backbone.layer2.1.conv.4.running_mean", "backbone.layer2.1.conv.4.running_var", "backbone.layer2.1.conv.6.weight", "backbone.layer2.1.conv.7.weight", "backbone.layer2.1.conv.7.bias", "backbone.layer2.1.conv.7.running_mean", "backbone.layer2.1.conv.7.running_var", "backbone.layer3.0.conv.0.weight", "backbone.layer3.0.conv.1.weight", "backbone.layer3.0.conv.1.bias", "backbone.layer3.0.conv.1.running_mean", "backbone.layer3.0.conv.1.running_var", "backbone.layer3.0.conv.3.weight", "backbone.layer3.0.conv.4.weight", "backbone.layer3.0.conv.4.bias", "backbone.layer3.0.conv.4.running_mean", "backbone.layer3.0.conv.4.running_var", "backbone.layer3.0.conv.6.weight", "backbone.layer3.0.conv.7.weight", "backbone.layer3.0.conv.7.bias", "backbone.layer3.0.conv.7.running_mean", "backbone.layer3.0.conv.7.running_var", "backbone.layer3.1.conv.0.weight", "backbone.layer3.1.conv.1.weight", "backbone.layer3.1.conv.1.bias", "backbone.layer3.1.conv.1.running_mean", "backbone.layer3.1.conv.1.running_var", "backbone.layer3.1.conv.3.weight", "backbone.layer3.1.conv.4.weight", "backbone.layer3.1.conv.4.bias", "backbone.layer3.1.conv.4.running_mean", "backbone.layer3.1.conv.4.running_var", "backbone.layer3.1.conv.6.weight", "backbone.layer3.1.conv.7.weight", "backbone.layer3.1.conv.7.bias", "backbone.layer3.1.conv.7.running_mean", "backbone.layer3.1.conv.7.running_var", "backbone.layer3.2.conv.0.weight", "backbone.layer3.2.conv.1.weight", "backbone.layer3.2.conv.1.bias", "backbone.layer3.2.conv.1.running_mean", "backbone.layer3.2.conv.1.running_var", "backbone.layer3.2.conv.3.weight", "backbone.layer3.2.conv.4.weight", "backbone.layer3.2.conv.4.bias", "backbone.layer3.2.conv.4.running_mean", "backbone.layer3.2.conv.4.running_var", "backbone.layer3.2.conv.6.weight", "backbone.layer3.2.conv.7.weight", "backbone.layer3.2.conv.7.bias", "backbone.layer3.2.conv.7.running_mean", "backbone.layer3.2.conv.7.running_var", "backbone.layer4.0.conv.0.weight", "backbone.layer4.0.conv.1.weight", "backbone.layer4.0.conv.1.bias", "backbone.layer4.0.conv.1.running_mean", "backbone.layer4.0.conv.1.running_var", "backbone.layer4.0.conv.3.weight", "backbone.layer4.0.conv.4.weight", "backbone.layer4.0.conv.4.bias", "backbone.layer4.0.conv.4.running_mean", "backbone.layer4.0.conv.4.running_var", "backbone.layer4.0.conv.6.weight", "backbone.layer4.0.conv.7.weight", "backbone.layer4.0.conv.7.bias", "backbone.layer4.0.conv.7.running_mean", "backbone.layer4.0.conv.7.running_var", "backbone.layer4.1.conv.0.weight", "backbone.layer4.1.conv.1.weight", "backbone.layer4.1.conv.1.bias", "backbone.layer4.1.conv.1.running_mean", "backbone.layer4.1.conv.1.running_var", "backbone.layer4.1.conv.3.weight", "backbone.layer4.1.conv.4.weight", "backbone.layer4.1.conv.4.bias", "backbone.layer4.1.conv.4.running_mean", "backbone.layer4.1.conv.4.running_var", "backbone.layer4.1.conv.6.weight", "backbone.layer4.1.conv.7.weight", "backbone.layer4.1.conv.7.bias", "backbone.layer4.1.conv.7.running_mean", "backbone.layer4.1.conv.7.running_var", "backbone.layer4.2.conv.0.weight", "backbone.layer4.2.conv.1.weight", "backbone.layer4.2.conv.1.bias", "backbone.layer4.2.conv.1.running_mean", "backbone.layer4.2.conv.1.running_var", "backbone.layer4.2.conv.3.weight", "backbone.layer4.2.conv.4.weight", "backbone.layer4.2.conv.4.bias", "backbone.layer4.2.conv.4.running_mean", "backbone.layer4.2.conv.4.running_var", "backbone.layer4.2.conv.6.weight", "backbone.layer4.2.conv.7.weight", "backbone.layer4.2.conv.7.bias", "backbone.layer4.2.conv.7.running_mean", "backbone.layer4.2.conv.7.running_var", "backbone.layer4.3.conv.0.weight", "backbone.layer4.3.conv.1.weight", "backbone.layer4.3.conv.1.bias", "backbone.layer4.3.conv.1.running_mean", "backbone.layer4.3.conv.1.running_var", "backbone.layer4.3.conv.3.weight", "backbone.layer4.3.conv.4.weight", "backbone.layer4.3.conv.4.bias", "backbone.layer4.3.conv.4.running_mean", "backbone.layer4.3.conv.4.running_var", "backbone.layer4.3.conv.6.weight", "backbone.layer4.3.conv.7.weight", "backbone.layer4.3.conv.7.bias", "backbone.layer4.3.conv.7.running_mean", "backbone.layer4.3.conv.7.running_var", "backbone.layer5.0.conv.0.weight", "backbone.layer5.0.conv.1.weight", "backbone.layer5.0.conv.1.bias", "backbone.layer5.0.conv.1.running_mean", "backbone.layer5.0.conv.1.running_var", "backbone.layer5.0.conv.3.weight", "backbone.layer5.0.conv.4.weight", "backbone.layer5.0.conv.4.bias", "backbone.layer5.0.conv.4.running_mean", "backbone.layer5.0.conv.4.running_var", "backbone.layer5.0.conv.6.weight", "backbone.layer5.0.conv.7.weight", "backbone.layer5.0.conv.7.bias", "backbone.layer5.0.conv.7.running_mean", "backbone.layer5.0.conv.7.running_var", "backbone.layer5.1.conv.0.weight", "backbone.layer5.1.conv.1.weight", "backbone.layer5.1.conv.1.bias", "backbone.layer5.1.conv.1.running_mean", "backbone.layer5.1.conv.1.running_var", "backbone.layer5.1.conv.3.weight", "backbone.layer5.1.conv.4.weight", "backbone.layer5.1.conv.4.bias", "backbone.layer5.1.conv.4.running_mean", "backbone.layer5.1.conv.4.running_var", "backbone.layer5.1.conv.6.weight", "backbone.layer5.1.conv.7.weight", "backbone.layer5.1.conv.7.bias", "backbone.layer5.1.conv.7.running_mean", "backbone.layer5.1.conv.7.running_var", "backbone.layer5.2.conv.0.weight", "backbone.layer5.2.conv.1.weight", "backbone.layer5.2.conv.1.bias", "backbone.layer5.2.conv.1.running_mean", "backbone.layer5.2.conv.1.running_var", "backbone.layer5.2.conv.3.weight", "backbone.layer5.2.conv.4.weight", "backbone.layer5.2.conv.4.bias", "backbone.layer5.2.conv.4.running_mean", "backbone.layer5.2.conv.4.running_var", "backbone.layer5.2.conv.6.weight", "backbone.layer5.2.conv.7.weight", "backbone.layer5.2.conv.7.bias", "backbone.layer5.2.conv.7.running_mean", "backbone.layer5.2.conv.7.running_var", "backbone.layer6.0.conv.0.weight", "backbone.layer6.0.conv.1.weight", "backbone.layer6.0.conv.1.bias", "backbone.layer6.0.conv.1.running_mean", "backbone.layer6.0.conv.1.running_var", "backbone.layer6.0.conv.3.weight", "backbone.layer6.0.conv.4.weight", "backbone.layer6.0.conv.4.bias", "backbone.layer6.0.conv.4.running_mean", "backbone.layer6.0.conv.4.running_var", "backbone.layer6.0.conv.6.weight", "backbone.layer6.0.conv.7.weight", "backbone.layer6.0.conv.7.bias", "backbone.layer6.0.conv.7.running_mean", "backbone.layer6.0.conv.7.running_var", "backbone.layer6.1.conv.0.weight", "backbone.layer6.1.conv.1.weight", "backbone.layer6.1.conv.1.bias", "backbone.layer6.1.conv.1.running_mean", "backbone.layer6.1.conv.1.running_var", "backbone.layer6.1.conv.3.weight", "backbone.layer6.1.conv.4.weight", "backbone.layer6.1.conv.4.bias", "backbone.layer6.1.conv.4.running_mean", "backbone.layer6.1.conv.4.running_var", "backbone.layer6.1.conv.6.weight", "backbone.layer6.1.conv.7.weight", "backbone.layer6.1.conv.7.bias", "backbone.layer6.1.conv.7.running_mean", "backbone.layer6.1.conv.7.running_var", "backbone.layer6.2.conv.0.weight", "backbone.layer6.2.conv.1.weight", "backbone.layer6.2.conv.1.bias", "backbone.layer6.2.conv.1.running_mean", "backbone.layer6.2.conv.1.running_var", "backbone.layer6.2.conv.3.weight", "backbone.layer6.2.conv.4.weight", "backbone.layer6.2.conv.4.bias", "backbone.layer6.2.conv.4.running_mean", "backbone.layer6.2.conv.4.running_var", "backbone.layer6.2.conv.6.weight", "backbone.layer6.2.conv.7.weight", "backbone.layer6.2.conv.7.bias", "backbone.layer6.2.conv.7.running_mean", "backbone.layer6.2.conv.7.running_var", "backbone.layer7.0.conv.0.weight", "backbone.layer7.0.conv.1.weight", "backbone.layer7.0.conv.1.bias", "backbone.layer7.0.conv.1.running_mean", "backbone.layer7.0.conv.1.running_var", "backbone.layer7.0.conv.3.weight", "backbone.layer7.0.conv.4.weight", "backbone.layer7.0.conv.4.bias", "backbone.layer7.0.conv.4.running_mean", "backbone.layer7.0.conv.4.running_var", "backbone.layer7.0.conv.6.weight", "backbone.layer7.0.conv.7.weight", "backbone.layer7.0.conv.7.bias", "backbone.layer7.0.conv.7.running_mean", "backbone.layer7.0.conv.7.running_var", "neck.downsample2.downsample.0.weight", "neck.downsample2.downsample.1.weight", "neck.downsample2.downsample.1.bias", "neck.downsample2.downsample.1.running_mean", "neck.downsample2.downsample.1.running_var", "neck.downsample3.downsample.0.weight", "neck.downsample3.downsample.1.weight", "neck.downsample3.downsample.1.bias", "neck.downsample3.downsample.1.running_mean", "neck.downsample3.downsample.1.running_var", "neck.downsample4.downsample.0.weight", "neck.downsample4.downsample.1.weight", "neck.downsample4.downsample.1.bias", "neck.downsample4.downsample.1.running_mean", "neck.downsample4.downsample.1.running_var", "rpn_head.rpn2.cls.conv_kernel.0.weight", "rpn_head.rpn2.cls.conv_kernel.1.weight", "rpn_head.rpn2.cls.conv_kernel.1.bias", "rpn_head.rpn2.cls.conv_kernel.1.running_mean", "rpn_head.rpn2.cls.conv_kernel.1.running_var", "rpn_head.rpn2.cls.conv_search.0.weight", "rpn_head.rpn2.cls.conv_search.1.weight", "rpn_head.rpn2.cls.conv_search.1.bias", "rpn_head.rpn2.cls.conv_search.1.running_mean", "rpn_head.rpn2.cls.conv_search.1.running_var", "rpn_head.rpn2.cls.head.0.weight", "rpn_head.rpn2.cls.head.1.weight", "rpn_head.rpn2.cls.head.1.bias", "rpn_head.rpn2.cls.head.1.running_mean", "rpn_head.rpn2.cls.head.1.running_var", "rpn_head.rpn2.cls.head.3.weight", "rpn_head.rpn2.cls.head.3.bias", "rpn_head.rpn2.loc.conv_kernel.0.weight", "rpn_head.rpn2.loc.conv_kernel.1.weight", "rpn_head.rpn2.loc.conv_kernel.1.bias", "rpn_head.rpn2.loc.conv_kernel.1.running_mean", "rpn_head.rpn2.loc.conv_kernel.1.running_var", "rpn_head.rpn2.loc.conv_search.0.weight", "rpn_head.rpn2.loc.conv_search.1.weight", "rpn_head.rpn2.loc.conv_search.1.bias", "rpn_head.rpn2.loc.conv_search.1.running_mean", "rpn_head.rpn2.loc.conv_search.1.running_var", "rpn_head.rpn2.loc.head.0.weight", "rpn_head.rpn2.loc.head.1.weight", "rpn_head.rpn2.loc.head.1.bias", "rpn_head.rpn2.loc.head.1.running_mean", "rpn_head.rpn2.loc.head.1.running_var", "rpn_head.rpn2.loc.head.3.weight", "rpn_head.rpn2.loc.head.3.bias", "rpn_head.rpn3.cls.conv_kernel.0.weight", "rpn_head.rpn3.cls.conv_kernel.1.weight", "rpn_head.rpn3.cls.conv_kernel.1.bias", "rpn_head.rpn3.cls.conv_kernel.1.running_mean", "rpn_head.rpn3.cls.conv_kernel.1.running_var", "rpn_head.rpn3.cls.conv_search.0.weight", "rpn_head.rpn3.cls.conv_search.1.weight", "rpn_head.rpn3.cls.conv_search.1.bias", "rpn_head.rpn3.cls.conv_search.1.running_mean", "rpn_head.rpn3.cls.conv_search.1.running_var", "rpn_head.rpn3.cls.head.0.weight", "rpn_head.rpn3.cls.head.1.weight", "rpn_head.rpn3.cls.head.1.bias", "rpn_head.rpn3.cls.head.1.running_mean", "rpn_head.rpn3.cls.head.1.running_var", "rpn_head.rpn3.cls.head.3.weight", "rpn_head.rpn3.cls.head.3.bias", "rpn_head.rpn3.loc.conv_kernel.0.weight", "rpn_head.rpn3.loc.conv_kernel.1.weight", "rpn_head.rpn3.loc.conv_kernel.1.bias", "rpn_head.rpn3.loc.conv_kernel.1.running_mean", "rpn_head.rpn3.loc.conv_kernel.1.running_var", "rpn_head.rpn3.loc.conv_search.0.weight", "rpn_head.rpn3.loc.conv_search.1.weight", "rpn_head.rpn3.loc.conv_search.1.bias", "rpn_head.rpn3.loc.conv_search.1.running_mean", "rpn_head.rpn3.loc.conv_search.1.running_var", "rpn_head.rpn3.loc.head.0.weight", "rpn_head.rpn3.loc.head.1.weight", "rpn_head.rpn3.loc.head.1.bias", "rpn_head.rpn3.loc.head.1.running_mean", "rpn_head.rpn3.loc.head.1.running_var", "rpn_head.rpn3.loc.head.3.weight", "rpn_head.rpn3.loc.head.3.bias", "rpn_head.rpn4.cls.conv_kernel.0.weight", "rpn_head.rpn4.cls.conv_kernel.1.weight", "rpn_head.rpn4.cls.conv_kernel.1.bias", "rpn_head.rpn4.cls.conv_kernel.1.running_mean", "rpn_head.rpn4.cls.conv_kernel.1.running_var", "rpn_head.rpn4.cls.conv_search.0.weight", "rpn_head.rpn4.cls.conv_search.1.weight", "rpn_head.rpn4.cls.conv_search.1.bias", "rpn_head.rpn4.cls.conv_search.1.running_mean", "rpn_head.rpn4.cls.conv_search.1.running_var", "rpn_head.rpn4.cls.head.0.weight", "rpn_head.rpn4.cls.head.1.weight", "rpn_head.rpn4.cls.head.1.bias", "rpn_head.rpn4.cls.head.1.running_mean", "rpn_head.rpn4.cls.head.1.running_var", "rpn_head.rpn4.cls.head.3.weight", "rpn_head.rpn4.cls.head.3.bias", "rpn_head.rpn4.loc.conv_kernel.0.weight", "rpn_head.rpn4.loc.conv_kernel.1.weight", "rpn_head.rpn4.loc.conv_kernel.1.bias", "rpn_head.rpn4.loc.conv_kernel.1.running_mean", "rpn_head.rpn4.loc.conv_kernel.1.running_var", "rpn_head.rpn4.loc.conv_search.0.weight", "rpn_head.rpn4.loc.conv_search.1.weight", "rpn_head.rpn4.loc.conv_search.1.bias", "rpn_head.rpn4.loc.conv_search.1.running_mean", "rpn_head.rpn4.loc.conv_search.1.running_var", "rpn_head.rpn4.loc.head.0.weight", "rpn_head.rpn4.loc.head.1.weight", "rpn_head.rpn4.loc.head.1.bias", "rpn_head.rpn4.loc.head.1.running_mean", "rpn_head.rpn4.loc.head.1.running_var", "rpn_head.rpn4.loc.head.3.weight", "rpn_head.rpn4.loc.head.3.bias", "predictor.conv_kernel.0.weight", "predictor.conv_kernel.1.weight", "predictor.conv_kernel.1.bias", "predictor.conv_kernel.1.running_mean", "predictor.conv_kernel.1.running_var", "predictor.conv_search.0.weight", "predictor.conv_search.1.weight", "predictor.conv_search.1.bias", "predictor.conv_search.1.running_mean", "predictor.conv_search.1.running_var", "predictor.hidden_conv.0.weight", "predictor.hidden_conv.1.weight", "predictor.hidden_conv.1.bias", "predictor.hidden_conv.1.running_mean", "predictor.hidden_conv.1.running_var", "predictor.input_encode.0.weight", "predictor.input_encode.0.bias", "predictor.input_encode.1.weight", "predictor.input_encode.1.bias", "predictor.interact_m.0.weight", "predictor.interact_m.0.bias", "predictor.interact_m.1.weight", "predictor.interact_m.1.bias", "predictor.interact_m.1.running_mean", "predictor.interact_m.1.running_var", "predictor.interact_v.0.weight", "predictor.interact_v.0.bias", "predictor.interact_v.1.weight", "predictor.interact_v.1.bias", "predictor.interact_v.1.running_mean", "predictor.interact_v.1.running_var", "predictor.mid_hidden_m.0.weight", "predictor.mid_hidden_m.0.bias", "predictor.mid_hidden_m.1.weight", "predictor.mid_hidden_m.1.bias", "predictor.mid_hidden_m.1.running_mean", "predictor.mid_hidden_m.1.running_var", "predictor.mid_hidden_v.0.weight", "predictor.mid_hidden_v.0.bias", "predictor.mid_hidden_v.1.weight", "predictor.mid_hidden_v.1.bias", "predictor.mid_hidden_v.1.running_mean", "predictor.mid_hidden_v.1.running_var", "predictor.mid_hidden_mv.0.weight", "predictor.mid_hidden_mv.0.bias", "predictor.mid_hidden_mv.1.weight", "predictor.mid_hidden_mv.1.bias", "predictor.mid_hidden_mv.1.running_mean", "predictor.mid_hidden_mv.1.running_var", "predictor.head.weight", "predictor.head.bias", "predictor.pred_head_v.0.weight", "predictor.pred_head_v.0.bias", "predictor.pred_head_v.1.weight", "predictor.pred_head_v.1.bias", "predictor.pred_head_v.2.weight", "predictor.pred_head_v.2.bias", "predictor.pred_head_m.0.weight", "predictor.pred_head_m.0.bias", "predictor.pred_head_m.1.weight", "predictor.pred_head_m.1.bias", "predictor.pred_head_m.2.weight", "predictor.pred_head_m.2.bias", "predictor.pred_head_mv.0.weight", "predictor.pred_head_mv.0.bias", "predictor.pred_head_mv.1.weight", "predictor.pred_head_mv.1.bias", "predictor.pred_head_mv.2.weight", "predictor.pred_head_mv.2.bias", "predictor.out_decode_v.0.weight", "predictor.out_decode_v.0.bias", "predictor.out_decode_v.2.weight", "predictor.out_decode_v.2.bias", "predictor.out_decode_m.0.weight", "predictor.out_decode_m.0.bias", "predictor.out_decode_m.2.weight", "predictor.out_decode_m.2.bias", "predictor.out_decode_mv.0.weight", "predictor.out_decode_mv.0.bias", "predictor.out_decode_mv.2.weight", "predictor.out_decode_mv.2.bias", "predictor.pred_loc_head.0.weight", "predictor.pred_loc_head.1.weight", "predictor.pred_loc_head.1.bias", "predictor.pred_loc_head.1.running_mean", "predictor.pred_loc_head.1.running_var", "predictor.pred_loc_head.3.weight", "predictor.pred_loc_head.3.bias". 
    Unexpected key(s) in state_dict: "epoch", "state_dict", "optimizer". 
Jaraxxus-Me commented 1 year ago

I never modified/used demo.py, I think you need to modify some code according to test.py, the loading function is a bit different in PVT++ compared to original pysot.

102447 commented 1 year ago

Do you slove this question?

ParaImage commented 1 year ago

It fix with choose "state_dict" key when load dic with torch.load