Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can pretrained models from torchvision hub be used with mmdetection? #8583

Open
barathsku opened this issue Aug 17, 2022 · 3 comments
Open
Assignees
Labels
feature request Request new features
Milestone

Comments

@barathsku
Copy link

barathsku commented Aug 17, 2022

Suppose a Faster R-CNN model or any other pretrained model is imported from torchvision hub (e.g., https://pytorch.org/vision/stable/models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn.html#torchvision.models.detection.fasterrcnn_resnet50_fpn), can it be loaded into mmdetection directly for performing inference or ONNX/TensorRT conversion? I know mmdetect provides pretrained models, but asking just in case. If not, why? Is there any architecture difference between the pretrained models here and pretrained models from torchvision hub?

@jbwang1997
Copy link
Collaborator

The architecture is almost the same. But the key names of pretrained models between torchvision and mmdet may be different. If you want to load torchvision model into mmdet, you need to convert the key name first.

@barathsku
Copy link
Author

What do you mean by key names? Do you have any example on how to convert the key names? @jbwang1997

@ZwwWayne
Copy link
Collaborator

It means the name of the parameters. To load these models, we need to convert the name of parameters so that they could match with those trained by MMDetection.

@ZwwWayne ZwwWayne assigned hhaAndroid and unassigned jbwang1997 Oct 21, 2022
@ZwwWayne ZwwWayne added this to the 3.0.0rc3 milestone Oct 21, 2022
@hhaAndroid hhaAndroid added the feature request Request new features label Oct 25, 2022
@hhaAndroid hhaAndroid reopened this Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request new features
Projects
None yet
Development

No branches or pull requests

4 participants