advice for the way of naming weights
vijosam opened this issue · comments
Thanks for your great work.
In your provided pre-trained weights for detectron2, I notice that the names of tensors start with backbone.bottom_up
(eg. backbone.bottom_up.stem.conv1_1.weight
), and I can not directly use them for other models such as C4 models. I have tried to rename them and enable loading weights by more models in detectron2. Here is my way to save the weights:
dict(model={"stem.conv1_1.weight": weights1, ...}, matching_heuristics=True)
By adding matching_heuristics=True
, we can use the automatic matching rules in detectron2 and do not need to add the prefix name manually.
Could you please consider updating your model weights?
Thanks for your advice!
For the pretrained model, you can download the model with standard names from torch.hub
# load pretrained models, using ResNeSt-50 as an example
net = torch.hub.load('zhanghang1989/ResNeSt', 'resnest50', pretrained=True)