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

Refactor new model.warmup() method #5810

Merged
merged 2 commits into from Nov 27, 2021
Merged

Refactor new model.warmup() method #5810

merged 2 commits into from Nov 27, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Nov 27, 2021

Adds warmup to TRT and ONNX models to avoid first batch timing artifacts. May resolve #5806

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Refactoring model warmup process in Ultralytics YOLOv5.

πŸ“Š Key Changes

  • Consolidated model warmup code into a single method warmup() within the Model class.
  • Removed conditional warmup checks from detect.py and val.py and replaced them with calls to the new warmup() method.

🎯 Purpose & Impact

  • Code Maintainability: Centralizing warmup logic makes the codebase cleaner and easier to maintain.
  • Consistency: Unified warmup approach ensures consistent behavior across different scripts within the repository.
  • Performance: The warmup is reserved for GPU use, potentially avoiding unnecessary resource usage on CPU devices.
  • End-User Impact: Streamlines internal code with no direct feature or performance changes for the end-users but sets the stage for a more robust and maintainable system.

@glenn-jocher glenn-jocher self-assigned this Nov 27, 2021
@glenn-jocher glenn-jocher merged commit fcd180d into master Nov 27, 2021
@glenn-jocher glenn-jocher deleted the update/warmup branch November 27, 2021 11:29
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Refactor new `model.warmup()` method

* Add half
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.

pre-process speed differs so much
1 participant