-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Support for image with no annotations in RetinaNet #3032
Support for image with no annotations in RetinaNet #3032
Conversation
56f791e
to
c5d2868
Compare
d6e2371
to
c5d2868
Compare
Rebasing this on the latest master fails an unrelated CI test: Let's try rebasing later to see if this was the result of a bug on nightly upstream. |
860669e
to
c5d2868
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome, much simpler and more consistent, thanks a lot Vasilis!
There seems to be something fishy with the failures on this PR. First of all the PR does not make any changes on the
I tried rebasing multiple times and every time I push the change it fails. Every time I undo the the rebase it succeeds. |
I did a dummy PR #3054 to remove the test introduced and rebase and it works. It seems that the DeformConv2d test for autocast is flaky and we hit a bad seed. I'm going to try to fix this here by setting the seed to a different value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple of comments to explain the flakiness we observed for future reference.
@@ -128,6 +128,15 @@ def test_forward_negative_sample_krcnn(self): | |||
self.assertEqual(loss_dict["loss_rpn_box_reg"], torch.tensor(0.)) | |||
self.assertEqual(loss_dict["loss_keypoint"], torch.tensor(0.)) | |||
|
|||
def test_forward_negative_sample_retinanet(self): | |||
model = torchvision.models.detection.retinanet_resnet50_fpn( | |||
num_classes=2, min_size=100, max_size=100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of this model initialisation leads to the use of a different random seed on a separate test. See below.
torchscript support `torch.dtype` now, refer to pytorch/vision#3032
* Enable support for images without annotations * Ensuring gradient propagates to RegressionHead. * Rewriting losses to remove branching. * Fix the seed on DeformConv autocast test.
Fixes #2800
Merge after #3031, coauthored with @fmassa.
To ensure that the patch in this branch does not affect the performance of the model I retrained it and compared it with master.
Branch
retinanet_resnet50_fpn + no annotations support: boxAP=36.4
Master
retinanet_resnet50_fpn: boxAP=36.4
The above master metrics were taken from the recently merged PR on #2954.