Fix: resolution kwarg silently ignored in RFDETR.train()#933
Draft
Fix: resolution kwarg silently ignored in RFDETR.train()#933
Conversation
2 tasks
…ig.resolution Agent-Logs-Url: https://github.com/roboflow/rf-detr/sessions/8cb000ce-15e1-42c1-bd22-2d383e3176de Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Agent-Logs-Url: https://github.com/roboflow/rf-detr/sessions/8cb000ce-15e1-42c1-bd22-2d383e3176de Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix image size not changing with resolution argument
Fix: resolution kwarg silently ignored in RFDETR.train()
Apr 8, 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.
TrainConfigextends plainBaseModel(extra fields ignored), so passingresolution=Nto.train()was silently dropped — the model always trained at the default config resolution regardless of what the user set.Changes
RFDETR.train()now absorbsresolutionbefore forwarding remaining kwargs toget_train_config():patch_size × num_windows(raisesValueErrorif not)self.model_config.resolutionpositional_encoding_size = resolution // patch_sizeresolutionas a first-class.train()kwargUsage
Invalid resolutions raise immediately with a clear message:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://storage.googleapis.com/rfdetr/nano_coco/checkpoint_best_regular.pth/usr/bin/python python -m pytest tests/training/ src/ -x -v -m not gpu --ignore=tests/training/test_metrics_csv.py(http block)/usr/bin/python python -m pytest src/rfdetr/detr.py::rfdetr.detr.RFDETR.optimize_for_inference -v(http block)/usr/bin/python python -m pytest src/rfdetr/detr.py::rfdetr.detr.RFDETR.optimize_for_inference -v --tb=short(http block)https://storage.googleapis.com/rfdetr/rf-detr-seg-n-ft.pth/usr/bin/python python -m pytest tests/ src/ -v -m not gpu --ignore=tests/training/test_metrics_csv.py --ignore=src/rfdetr/detr.py --ignore=tests/try_instantiate_all_models.py(http block)huggingface.co/usr/bin/python python -m pytest tests/ src/ -v -m not gpu --ignore=tests/training/test_metrics_csv.py --ignore=src/rfdetr/detr.py --ignore=tests/try_instantiate_all_models.py(dns block)images.cocodataset.org/usr/bin/python python -m pytest tests/ src/ -v -m not gpu --ignore=tests/training/test_metrics_csv.py --ignore=src/rfdetr/detr.py --ignore=tests/try_instantiate_all_models.py(dns block)If you need me to access, download, or install something from one of these locations, you can either: