-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Adds Anchor tests #2971
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
Adds Anchor tests #2971
Conversation
Hi, I think that something like this Lines 197 to 200 in 052edce
and Lines 268 to 284 in 052edce
could be added to the unittest? |
Hi Thanks for the PR! @oke-aditya Test failures are related, can you have a look? @zhiqwang yes, we can improve testing of AnchorGenerator to check for correctness as well, and this is just a first PR to start this effort. I think tests which would be useful would be tests for a few known values of a very small feature map size, so that we know the ground-truth. |
Yes the failures are related. The reason is I'm not able to generate |
@oke-aditya might be because of vision/torchvision/models/detection/anchor_utils.py Lines 42 to 46 in 5a4bb19
I think you should add instead a tuple of tuple, but with different sizes |
Hi @fmassa , Yep, It's my pleasure, I will trace this current PR, and check what can I contribute to following up this PR. |
I'm really unsure what code would generate the error. I have tried various combinations locally but no success yet. Following is what I tried to generate the I think there is some confusion.
This assert actually checks if sizes and aspect ratios match. This can be easily triggered.
But this
is a call to very internal code in the Some test cases that didn't work to fix the
Passing only tuple too didn't work. I think that it needs further digging into code. |
@oke-aditya you need to set the |
Ah, now I get it. I have fixed the test. 😄 |
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.
Thanks!
* tries adding anchor tests * fixes lint * tries fixing * tries one more time * fixes the test
* tries adding anchor tests * fixes lint * tries fixing * tries one more time * fixes the test
Followup PR. Adds tests for #2960
Somehow I was not able to run tests locally. I'm unsure if this is fixed quite well.
I'm not sure what and how tests can or should be for this, somehow it simply creates an empty Anchor and no ValueErorr is generated.