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

Export with official nn.SiLU() #7256

Merged
merged 2 commits into from
Apr 3, 2022
Merged

Export with official nn.SiLU() #7256

merged 2 commits into from
Apr 3, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Apr 3, 2022

Remove utils.activations.SiLU replacement for nn.SiLU on export. This was in place for export support on some formats that did not recognize PyTorch's nn.SiLU module, but now all export formats fully support this. Note may require coremltools>=5.1 for CoreML exports, not tested with coremltools==4.1 support.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Simplified model activation functions and updated non-max suppression timing parameters in YOLOv5 export script.

📊 Key Changes

  • Removed specific activation function handling (SiLU) during model export.
  • Removed unused imports (torch.nn, Conv, and SiLU modules).
  • Increased the base non-max suppression time limit from dynamic-only to a static base time plus a dynamic component based on batch size.

🎯 Purpose & Impact

  • Simplifying activation functions helps streamline the export process and removes potential obstacles when converting models for mobile or other platforms. 🚀
  • Cleaning up imports reduces clutter and slightly improves code maintainability. 🧹
  • Adjusting the non-max suppression timing ensures the algorithm has enough time to process the results even with larger batch sizes, which could improve detection reliability at the cost of potential slight latency increase. ⏱️💡

These changes collectively work towards optimizing YOLOv5's performance and usability across different deployment scenarios. Users can expect a smoother export process for their trained models with these updates.

@glenn-jocher glenn-jocher changed the title Export/silu Export with nn.SiLU() Apr 3, 2022
@glenn-jocher glenn-jocher changed the title Export with nn.SiLU() Export with official nn.SiLU() Apr 3, 2022
@glenn-jocher glenn-jocher self-assigned this Apr 3, 2022
@glenn-jocher glenn-jocher merged commit ffcbd8c into master Apr 3, 2022
@glenn-jocher glenn-jocher deleted the export/silu branch April 3, 2022 16:45
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Update

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

1 participant