Skip to content

Avoid weight download on test_detection_model_trainable_backbone_layers test #4659

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ def test_detection_model_trainable_backbone_layers(model_name):
n_trainable_params = []
for trainable_layers in range(0, max_trainable + 1):
model = torchvision.models.detection.__dict__[model_name](
pretrained=False, pretrained_backbone=True, trainable_backbone_layers=trainable_layers
pretrained=False, pretrained_backbone=False, trainable_backbone_layers=trainable_layers
Copy link
Contributor

Choose a reason for hiding this comment

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

Related test failures? I see a bunch of detection model tests failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the flag. Yes they are related.

The value of the boolean unfortunately affects the number of unfrozen weights... I think we need to rethink how we test this cause we shouldn't be downloading any weights without having setup a caching mechanism.

I think I'm going to close the PR and review how to solve this on a follow up PR.

cc @jdsgomes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New issue created at #4660

)

n_trainable_params.append(len([p for p in model.parameters() if p.requires_grad]))
Expand Down