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

TRT --half fix autocast images to FP16 #8435

Merged
merged 2 commits into from
Jul 1, 2022
Merged

TRT --half fix autocast images to FP16 #8435

merged 2 commits into from
Jul 1, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jul 1, 2022

Resolves bug raised in #7822

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Implementing automatic FP16 (half precision) image casting in YOLOv5 for improved efficiency.

πŸ“Š Key Changes

  • Added a conditional check to automatically convert input images to FP16 before inference if the model is set to use FP16 and the images aren't already in that format.

🎯 Purpose & Impact

  • Purpose: This change is intended to ensure that the model uses the correct precision for image inputs to match the model's operating precision mode (FP16 in this case), which wasn't explicitly enforced before.
  • Impact: Users can expect more consistent and possibly faster performance, especially on hardware that benefits from half-precision computations. This is particularly relevant for GPUs that are optimized for FP16 operations, leading to more efficient utilization of resources. πŸš€

@glenn-jocher glenn-jocher self-assigned this Jul 1, 2022
@glenn-jocher glenn-jocher linked an issue Jul 1, 2022 that may be closed by this pull request
2 tasks
@glenn-jocher glenn-jocher merged commit d94b470 into master Jul 1, 2022
@glenn-jocher glenn-jocher deleted the trt/fix branch July 1, 2022 13:41
Shivvrat pushed a commit to Shivvrat/epic-yolov5 that referenced this pull request Jul 12, 2022
* TRT `--half` fix autocast images to FP16

Resolves bug raised in ultralytics#7822

* Update common.py
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* TRT `--half` fix autocast images to FP16

Resolves bug raised in ultralytics#7822

* Update common.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.

inference with tensorrt on torch.hub doesnt work properly
1 participant