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 .train() mode exports #9429

Merged
merged 2 commits into from
Sep 15, 2022
Merged

Remove .train() mode exports #9429

merged 2 commits into from
Sep 15, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Sep 15, 2022

No common use cases.

Signed-off-by: Glenn Jocher [email protected]

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved ONNX export functionality for YOLOv5 models.

📊 Key Changes

  • Removed the train parameter from export_onnx function signature.
  • Set do_constant_folding=True by default in ONNX export.
  • The model is set to evaluation mode (model.eval()) by default during export, instead of toggling between training and evaluation modes.
  • Removed train parameter and related conditional logic in the run function and parse_opt function signature for export script.

🎯 Purpose & Impact

  • ⚙️ Consistency: The ONNX export will consistently perform constant folding, which often results in a smaller and more efficient model.
  • 👁️ Simplification: Simplifies the export process by removing the need for the user to specify the mode (train vs. eval) during export.
  • 🔄 Usability: This change aids both new and existing users by reducing the number of parameters and potential for confusion.
  • 🚀 Performance and Reliability: By always exporting the model in the evaluation mode, exported models are optimized for inference, which is the common use case, lending to potential performance improvements in downstream tasks.

No common use cases.

Signed-off-by: Glenn Jocher <[email protected]>
@glenn-jocher glenn-jocher linked an issue Sep 15, 2022 that may be closed by this pull request
1 task
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.

when export model file,report an error
1 participant