hub icon indicating copy to clipboard operation
hub copied to clipboard

`ultralytics_tflite` format exporting not work as expected

Open dingniaoji opened this issue 1 year ago • 1 comments

Search before asking

  • [X] I have searched the HUB issues and found no similar bug report.

HUB Component

No response

Bug

ScreenShot 2024-09-18 161034

I have tried several times in past week, the android export does not work as expected.

It keeps exporting for hours, and never get done.

When I use chrome developer tool to inspect the network. the request POST payload is {"format":"ultralytics_tflite"} and the response is {"data":{},"message":"Exporting model.","success":true}.

this is my model id: e16HsBOqENqN23dipigh.

Environment

No response

Minimal Reproducible Example

No response

Additional

No response

dingniaoji avatar Sep 18 '24 08:09 dingniaoji

👋 Hello @dingniaoji, thank you for raising an issue about the Ultralytics HUB 🚀! This is an automated response, but an Ultralytics engineer will assist you soon.

In the meantime, please check out our HUB Docs for more information:

  • Quickstart: Start training and deploying YOLO models with HUB in seconds.
  • Android Exports: Explore TFLite acceleration on mobile devices and ensure your environment is properly set up.
  • Models: Training and Exporting: Learn how to train YOLO models and export them in various formats, including ultralytics_tflite.

Could you provide a minimum reproducible example (MRE) with more details on the issue, such as the specific steps you followed? This will help us diagnose the problem more effectively. You can refer to our guide on creating a Minimum Reproducible Example.

If you have any screenshots or logs to share, that would also be very helpful in solving the issue 🐛.

Thank you for your patience while we work on resolving this! 😊

UltralyticsAssistant avatar Sep 18 '24 08:09 UltralyticsAssistant

Hi there! 😊

Thank you for bringing this issue to our attention. It seems like you're experiencing difficulties with exporting your model in the ultralytics_tflite format. Let's try to resolve this together.

First, please ensure that you are using the latest version of the Ultralytics HUB and related packages, as updates often contain important bug fixes and improvements.

If the issue persists, here are a few steps you can try:

  1. Check for Network Issues: Sometimes, network interruptions can cause prolonged exporting times. Ensure your internet connection is stable.

  2. Try a Different Browser: Occasionally, browser-specific issues can affect operations. Testing the export process in a different browser might help.

  3. Inspect Logs: If possible, check the logs for any error messages that might provide more insight into what's happening during the export process.

  4. Alternative Export Formats: As a temporary workaround, you might want to try exporting your model to another format like ONNX or CoreML to see if the issue is specific to the ultralytics_tflite format.

If none of these steps resolve the issue, please let us know, and we can investigate further. Your feedback is invaluable, and we appreciate your patience as we work to improve our tools. 🚀

Feel free to reach out if you have any more questions or need further assistance!

pderrenger avatar Nov 09 '24 06:11 pderrenger

for others who came to this question: the problem is about the model arch you chose, m/x may not work at mobile.

dingniaoji avatar Apr 02 '25 01:04 dingniaoji

Thank you for sharing this observation! 🚨 While YOLO models are generally mobile-friendly, there can indeed be architecture-specific optimizations needed for different deployment targets. For Android TFLite exports in particular:

  1. Model Selection: We recommend starting with our mobile-optimized architectures like YOLO-Nano (n) or YOLO-Small (s) which have better success rates for mobile deployment
  2. Export Verification: You can check your model's compatibility by:
from ultralytics import hub
print(hub.export_fmts_hub())  # Verify supported formats
  1. Architecture Considerations: Some operators in larger models (m/l/x) may require custom TFLite delegates or specific hardware acceleration

If you're encountering persistent issues, please:

  1. Check the browser console logs during export (F12 > Console)
  2. Share any error messages from the Ultralytics HUB Cloud Training logs
  3. Try exporting via CLI as a workaround:
yolo export model=your_model.pt format=ultralytics_tflite

For mobile deployment best practices, see our Android export guide. If the issue persists, we'd appreciate you opening a new issue with your model architecture details and export logs so we can investigate further! 🔍

This helps us improve mobile compatibility for all users. Thank you for helping make YOLO better! 🙏

pderrenger avatar Apr 02 '25 09:04 pderrenger