Skip to content

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