fix(rfdetr): accept dict-form checkpoint args in classname extraction#487
Merged
Conversation
40d3ff8 to
fdbc0d8
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
51efe63 to
167cf90
Compare
`get_classnames_txt_for_rfdetr` called `vars(checkpoint["args"])`, which raises TypeError when `args` is a plain dict rather than an argparse.Namespace (e.g. rf-detr EMA checkpoints). Normalize to a dict before lookups. Add tests covering both shapes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
typer 0.26 vendors its own click as `typer._click` and drops the external click dependency, so roboflow.cli imports fail (click absent) and _compat.py mistypes under mypy. typer 0.25.x still depends on external click. Pin typer<0.26 and declare click explicitly in requirements.txt and requirements-slim.txt so the build matrix and test-slim pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
167cf90 to
d2277f6
Compare
leeclemnet
commented
May 29, 2026
| filetype | ||
| typer>=0.12.0 | ||
| typer>=0.12.0,<0.26 # 0.26 vendors click, dropping the external dep the CLI imports | ||
| click>=8.0 |
Contributor
Author
There was a problem hiding this comment.
CI broken without this
probicheaux
previously approved these changes
May 29, 2026
68dd065 to
ea61d12
Compare
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ea61d12 to
15fec18
Compare
probicheaux
approved these changes
May 29, 2026
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.
What does this PR do?
In
get_classnames_txt_for_rfdetr, normalizescheckpoint["args"]to a dict instead of callingvars()on it directly, and adds tests for both dict andNamespaceshapes.vars(checkpoint["args"])raisesTypeError: vars() argument must have __dict__ attributewhenargsis a plain dict rather than anargparse.Namespace. rf-detr EMA checkpoints (e.g.checkpoint_best_ema.pth) storeargsas a dict.Today this is masked when a
class_names.txtalready exists in the upload dir (the function short-circuits before reachingvars()), but it breaks for any rf-detr checkpoint with dict-form args that relies on extracting class names from the checkpoint.Related Issue(s): Companion to the server-side conversion fix roboflow/roboflow-model-conversion#93, which hit the same dict-vs-Namespace assumption on
args.resolutionand caused real prod upload failures (Medra workspace,rfdetr-seg-medium).Type of Change
Testing
Test details:
python -m unittest tests.util.test_model_processor→ 14 tests pass, including newGetClassnamesTxtForRfdetrTestcovering bothargsshapes. Thetest_dict_argscase reproduces thevars()TypeError against the old code.ruff format --checkandruff checkclean on the changed files; pre-commit hooks passed on push.Checklist
Additional Context
The two normalizations point opposite directions on purpose: this site needs a dict (downstream does
args["class_names"]), while the conversion site needs a Namespace (downstream doesargs.resolution). Each normalizes toward what its own caller expects.