Skip to content

Conversation

glenn-jocher
Copy link
Member

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

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved macOS compatibility and error handling for TensorFlow dependency resolution in YOLOv5 export script.

πŸ“Š Key Changes

  • Added a MACOS constant to efficiently check for macOS environments throughout the export script.
  • Modified CoreML export to use MACOS when determining support for quantization.
  • Updated TensorFlow import block to handle exceptions and install the correct TensorFlow package depending on the user's OS and available hardware (e.g., with or without CUDA support).
  • Adjusted requirements.txt to indicate possible TensorFlow variants (-cpu, -aarch64, -macos) that may be installed based on user needs and system configuration.

🎯 Purpose & Impact

  • Enhances Clarity: Using a MACOS constant makes the code clearer and easier to maintain, particularly if macOS-specific checks are needed elsewhere.
  • Improves Usability: By automatically selecting the correct TensorFlow package at runtime, users benefit from a smoother setup process without needing in-depth knowledge of the required dependencies for their specific setup.
  • Error Handling: The update improves the script's robustness by ensuring that an appropriate error message is displayed and the correct TensorFlow package is installed if the initial import fails. This helps prevent user confusion and streamlines troubleshooting.

@glenn-jocher glenn-jocher self-assigned this Sep 18, 2022
@glenn-jocher glenn-jocher merged commit 92b5242 into master Sep 18, 2022
@glenn-jocher glenn-jocher deleted the tensorflow/macos branch September 18, 2022 15:34
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