-
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
Changes to assert to ValueError in achor utils #2960
Conversation
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 for the PR!
I believe there is an issue with the logic, can you double-check?
raise ValueError('''Achors should be Tuple[Tuple[int]] because each feature | ||
map could potentially have different sizes and aspect ratios ''') |
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.
Can you use a single "
, and not break the line as currently done, as it introduces artifacts on the print?
Also, can you make the error message a bit more descriptive, as you can have Tuple[Tuple[int]]
being passed but still have the same problem. The underlying issue is that there needs to be a match between the number of feature maps passed and the number of sizes / aspect ratios specified.
Extremely sorry for such rookie error in code 🙏 |
Codecov Report
@@ Coverage Diff @@
## master #2960 +/- ##
==========================================
- Coverage 73.43% 73.41% -0.02%
==========================================
Files 99 99
Lines 8813 8814 +1
Branches 1391 1392 +1
==========================================
- Hits 6472 6471 -1
- Misses 1916 1917 +1
- Partials 425 426 +1
Continue to review full report at Codecov.
|
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 a lot!
For a follow-up PR, do you think you could send a PR adding a test for this ValueError?
Maybe in a file called test_models_detection_anchor_utils.py
?
Yep I will |
* changes to value error * fixes it :) * simpler fix
* changes to value error * fixes it :) * simpler fix
Fixes #2947
Just a small change to ValueError instead of assert. This will enhance debugging.