From 9f9db4b706c8d2e2809a94e1ffd17cb46ddd7d8e Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Fri, 4 Jun 2021 16:15:30 +0800 Subject: [PATCH] fix match weight (#3280) --- ppdet/utils/checkpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppdet/utils/checkpoint.py b/ppdet/utils/checkpoint.py index 0a4650402..9e079890c 100644 --- a/ppdet/utils/checkpoint.py +++ b/ppdet/utils/checkpoint.py @@ -164,7 +164,7 @@ def match_state_dict(model_state_dict, weight_state_dict): # In Faster RCNN, res5 pretrained weights have prefix of backbone, # however, the corresponding model weights have difficult prefix, # bbox_head. - b = b.strip('backbone.') + b = b[9:] return a == b or a.endswith("." + b) match_matrix = np.zeros([len(model_keys), len(weight_keys)]) -- GitLab