Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove formats variable to avoid pd conflict #7993

Merged
merged 2 commits into from
May 26, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 26, 2022

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved clarity and fixed export conditions in yolov5 model exporting and benchmark utilities.

πŸ“Š Key Changes

  • Renamed variable formats to fmts for better readability in export.py.
  • Modified conditional checks for half-precision (FP16) model conversions to be more explicit.
  • Adjusted assertions to prevent simultaneous TFLite and TF.js export, ensuring users export one format at a time.
  • Streamlined formats logic in benchmarking by calling export.export_formats() directly within loop iterations.

🎯 Purpose & Impact

  • πŸš€ The renaming of the variable improves code maintainability and understandability.
  • πŸ› οΈ More explicit conditionals reduce the potential for conversion errors when exporting models in different precision modes.
  • ⛔️ Explicit assertions guide users to avoid incorrect usage scenarios, such as trying to export incompatible formats together, enhancing user experience and preventing confusion.
  • 🧹 Inlining export.export_formats() calls simplifies the code and may slightly improve performance in benchmarks by reducing redundancy.

Overall, these changes contribute to a cleaner and more user-friendly codebase with better guidance on model exporting procedures.

@glenn-jocher glenn-jocher self-assigned this May 26, 2022
@glenn-jocher glenn-jocher merged commit 9455796 into master May 26, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch May 26, 2022 14:07
@glenn-jocher
Copy link
Member Author

@sazzadhrz this PR is unrelated to PyTorch HUB.

If you have a reproducible bug please submit a full bug report with exact code to reproduce, thank you!

tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this pull request Jun 10, 2022
* Remove `formats` variable to avoid `pd` conflict

* Update export.py
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Remove `formats` variable to avoid `pd` conflict

* Update export.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant