Add class names fallback for legacy checkpoints on export - #24715
Add class names fallback for legacy checkpoints on export#24715venu-banaras wants to merge 14 commits into
Conversation
|
👋 Hello @venu-banaras, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
The legacy names fallback logic and new ONNX regression coverage look solid overall, but there is one functional regression in exporter.py: the TensorRT <8.5.0 end-to-end safeguard was unintentionally removed when scoping the engine workaround to int8. The new tests should also skip cleanly when onnxruntime is unavailable.
💬 Posted 2 inline comments
|
I have read the CLA Document and I sign the CLA |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review 2
Made with ❤️ by Ultralytics Actions
The names fallback change looks directionally good and the new ONNX coverage helps, but there are two issues to address before merging: the TensorRT end-to-end compatibility logic regresses for non-INT8 engine exports, and the added tests still miss the new exception-driven fallback path they are meant to protect.
💬 Posted 2 inline comments
|
@glenn-jocher Kindly review. I was finally able to solve my original idea of legacy checkpoint fallback during ONNX export for names. |
|
Thanks for the update — using |
|
Yes those ideas will be separate PRs. this one is only checking if |
|
Thanks for confirming — keeping this PR limited to the exporter-side fallback for missing or invalid |
|
yes. now just waiting for feedback on my code... |
|
Thanks, noted — a maintainer will review the code when available; for now, please keep the PR unchanged unless you need to address CI or a clearly reproducible edge case. |
Keep check_class_names() validation errors loud instead of catching them, guard non-dict model.yaml, and drop the default_class_names import.
|
👋 Hello there! We wanted to let you know that we've decided to close this pull request due to inactivity. We appreciate the effort you put into contributing to our project, but unfortunately, not all contributions are suitable or aligned with our product roadmap. We hope you understand our decision, and please don't let it discourage you from contributing to open source projects in the future. We value all of our community members and their contributions, and we encourage you to keep exploring new projects and ways to get involved. For additional resources and information, please see the links below:
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
Problem
Older YOLO variant checkpoints sometimes saved without separate YAML files might sometimes have missing, None or malformed names property. Due to this and the current Exporter class logic, we immediately fallback to default_class_names() which assigns 999 generic classes silently, regardless of model's actual class count.
Solution
Add a fallback for export when a checkpoint's names property is missing, None or malformed, resolving it via model.yaml() before falling back to default_class_names().
Changes
Further improvements