Suppress chained fallback exceptions for RFDETR patch-size - #975
Merged
Merged
Conversation
…ression test Agent-Logs-Url: https://github.com/roboflow/rf-detr/sessions/9c59e32c-c132-46dc-a170-2b1b3687b3a7 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Agent-Logs-Url: https://github.com/roboflow/rf-detr/sessions/9c59e32c-c132-46dc-a170-2b1b3687b3a7 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Agent-Logs-Url: https://github.com/roboflow/rf-detr/sessions/9c59e32c-c132-46dc-a170-2b1b3687b3a7 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Borda
April 16, 2026 08:12
View session
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #975 +/- ##
======================================
Coverage 80% 80%
======================================
Files 100 100
Lines 8342 8343 +1
======================================
+ Hits 6632 6636 +4
+ Misses 1710 1707 -3 🚀 New features to boost your workflow:
|
Contributor
|
The AI somehow rigidly tied everything to RFDETRLarge and specific parameters... It probably shows up everywhere, and it shouldn't depend so much on constants. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the error surfaced by RFDETRLarge when its deprecated-config fallback retry also fails, ensuring users see a single deterministic “first attempt” compatibility error (without a chained secondary exception).
Changes:
- Suppress exception chaining when the deprecated-config retry fails by re-raising the original initialization error with
from None. - Add a regression test covering the “both attempts fail” scenario to ensure the first error is re-raised and context is suppressed.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/rfdetr/variants.py |
Suppresses chained exceptions when the deprecated-config retry fails by re-raising the original init error with from None. |
tests/training/test_detr_shim.py |
Adds a regression test asserting only the first patch-size mismatch error is raised and exception context is suppressed. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Borda
approved these changes
Apr 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
RFDETRLargeinitialization hits a patch-size compatibility error and the deprecated-config retry also fails, users currently see two conflictingValueErrors (patch_size=14andpatch_size=16) in one traceback. This obscures the actionable root cause from the initial load attempt.Problem surfaced
Behavior change in fallback re-raise
RFDETRLargefallback path to re-raise the original initialization error without chained context:Regression coverage
patch_size=14 -> 12,patch_size=16 -> 12,