Replies: 2 comments 1 reply
-
It's not an error. It occurs because the backbone network is pretrained on image classification tasks, where the last fc layer is required to generate the classification output. However, the fc layer is no longer needed when the backbone network is used to extract features in downstream tasks, and therefore these weights can be safely skipped when loading the checkpoint. |
Beta Was this translation helpful? Give feedback.
-
In the last version of MMOCR, when I try to do transfer learning by specifying load_from, freezing or not the backbone and neck, besides the 'unexpected key in source state_dict: fc.weight, fc.bias' warning, also appear the 'missing keys in source state_dict: backbone.stem.0.weight, backbone.stem.1.weight (...)' warning. |
Beta Was this translation helpful? Give feedback.
-
Hello,in mmocr0.6,By specifying load_from = 'https://download.openmmlab.com/mmocr/textdet/dbnet/dbnet_r18_fpnc_sbn_1200e_icdar2015_20210329-ba3ab597.pth', the result appears as follows Warning:
2023-02-22 18:03:35,041 - mmcv - WARNING - The model and loaded state dict do not match exactly
unexpected key in source state_dict: fc.weight, fc.bias
Beta Was this translation helpful? Give feedback.
All reactions