Skip to content

Conversation

@NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Dec 8, 2021

Hopefully fixes #5058. This does remove the warning but @pmeier please double check that this doesn't have undesired side effect!

cc @bjuncek

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Dec 8, 2021

💊 CI failures summary and remediations

As of commit 7ff78b1 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

Copy link
Contributor

@pmeier pmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That might conflict with

@handle_legacy_interface(
weights=(
"pretrained",
lambda kwargs: KeypointRCNN_ResNet50_FPN_Weights.Coco_Legacy
if kwargs["pretrained"] == "legacy"
else KeypointRCNN_ResNet50_FPN_Weights.Coco_V1,
),
weights_backbone=("pretrained_backbone", ResNet50_Weights.ImageNet1K_V1),
)
def keypointrcnn_resnet50_fpn(

Could you check if

models.detection.keypointrcnn_resnet50_fpn("legacy")

and

models.detection.keypointrcnn_resnet50_fpn(pretrained="legacy")

works as expected?

@NicolasHug
Copy link
Member Author

Good catch, thanks. Since this seems to be the only case where pretrained can be a string, I hardcoded it in the check.

Now both of these raise a warning (instead of failing before the last commit)

keypointrcnn_resnet50_fpn("legacy")
keypointrcnn_resnet50_fpn(pretrained="legacy")

Copy link
Contributor

@pmeier pmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @NicolasHug!

@NicolasHug NicolasHug merged commit d416b2c into pytorch:main Dec 8, 2021
@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Hey @NicolasHug!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

facebook-github-bot pushed a commit that referenced this pull request Dec 17, 2021
Reviewed By: fmassa

Differential Revision: D33185007

fbshipit-source-id: c69cdae11f6925462b181858f652e5bd29c083fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

handle_legacy_interface raises warning when passing weights=SomeString

3 participants