Fix/yoloe text model attribute in yoloe trainer from scratch#23428
Conversation
…l-attribute-in-YOLOETrainerFromScratch
|
👋 Hello @ShuaiLYU, thank you for submitting a -✅ Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions. For more guidance, please refer to our Contributing Guide. This is an automated note 🤖—an engineer will assist shortly. 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
PR looks clean. The changes align with the intended behavior and don’t introduce any obvious issues.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This pull request updates the way the text model is referenced and used in the
generate_text_embeddingsmethod, improving clarity and robustness. The most important change is using the unwrapped model'stext_modelattribute directly, which helps avoid ambiguity and potential errors when handling different model wrappers.Improvements to model handling:
generate_text_embeddingsfrom a hardcoded string to dynamically useunwrap_model(self.model).text_model, ensuring the correct model is used and improving maintainability.<!--Thank you 🙏 for your contribution to Ultralytics 🚀! Your effort in enhancing our repositories is greatly appreciated. To streamline the process and assist us in integrating your Pull Request (PR) effectively, please follow these steps:
Check for Existing Contributions: Before submitting, kindly explore existing PRs to ensure your contribution is unique and complementary.
Link Related Issues: If your PR addresses an open issue, please link it in your submission. This helps us better understand the context and impact of your contribution.
Elaborate Your Changes: Clearly articulate the purpose of your PR. Whether it's a bug fix or a new feature, a detailed description aids in a smoother integration process.
Ultralytics Contributor License Agreement (CLA): To uphold the quality and integrity of our project, we require all contributors to sign the CLA. Please confirm your agreement by commenting below:
I have read the CLA Document and I sign the CLA
For more detailed guidance and best practices on contributing, refer to our ✅ Contributing Guide. Your adherence to these guidelines ensures a faster and more effective review process.
-->
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Fix YOLOE trainer text-embedding cache key to use the actual configured
text_modelinstead of a hardcoded string 🧠📊 Key Changes
generate_text_embeddings()to derivemodelfromunwrap_model(self.model).text_modelrather than the hardcoded"mobileclip:blt"assert self.model is not Nonebefore callingunwrap_model(self.model).get_text_pe(...)🎯 Purpose & Impact