Closed Zoxive closed 11 months ago
Thanks for your interest! I'd like to confirm that this is expected for a pretrain model to contain classifier weights. Because the classifier is not needed in transferring the pretrain model to the object detection task, these info messages are expected and normal.
Thank you for responding. I have much to learn.
What lead me down that area, is ive trained a RepViT model on a custom dataset.
When i try to export it using export_coreml.py
it errors that the model
key doesnt exist.. so i changed it to use state_dict
which does exist. dict_keys(['meta', 'state_dict', 'optimizer'])
Which then gets further along but then it errors actually loading the pytorch checkpoint
Missing key(s) in state_dict:
"features.0.0.c.weight",
"features.0.0.bn.weight",
"features.0.0.bn.bias",
"features.0.0.bn.running_mean",
"features.0.0.bn.running_var",
"features.0.2.c.weight",
"features.0.2.bn.weight",
"features.0.2.bn.bias",
....(trimmed)
Unexpected key(s) in state_dict:
"backbone.features.0.0.c.weight",
"backbone.features.0.0.bn.weight",
"backbone.features.0.0.bn.bias",
"backbone.features.0.0.bn.running_mean",
"backbone.features.0.0.bn.running_var",
"backbone.features.0.0.bn.num_batches_tracked",
"backbone.features.0.2.c.weight",
"backbone.features.0.2.bn.weight",
"backbone.features.0.2.bn.bias",
...(trimmed)
With a keen eye it looks like all the weights are there, but nested in backbone
when the model is expecting them at the root.
This leads me to ask a bunch of questions, as this is at the edge of my knowledge.
detection/repvit.py
which is a mmdetection registered RepViT model not compatible with the timm model defined in model/repvit.py
?configs/mask_rcnn_repvit_m1_1_fpn_1x_coco.py
while overwriting the coco num_labels and dataset paths)replace 'backbone.', ''
I think the third is the right answer, i.e., replacing 'backbone' with ''.
I am new to CV so please forgive me if this is my error.
While attempting to run detection via:
python train.py configs/mask_rcnn_repvit_m1_1_fpn_1x_coco.py
I noticed these info messages at the top. After much googling around I could not find a definitive answer if this is expected for a pretrain model to contain classifier weights or not.
Is it possibly some wires crossed after the recent commit? https://github.com/THU-MIG/RepViT/commit/b749e1fee4f86102068eca70edbf74da1d3792aa#diff-cd9ebb250c84a1c86ee23bcc16dda442f62aaa4e6201916d61b5c191d0eae46b