-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
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
convert to tflite #11555
Comments
👋 Hello @nurulamelia2, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. RequirementsPython>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Introducing YOLOv8 🚀We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀! Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects. Check out our YOLOv8 Docs for details and get started with: pip install ultralytics |
@nurulamelia2 hi there! Thank you for your interest in YOLOv5. To convert best.pt to tflite, you can use the
After running this command, you will have a |
sorry I want to ask again, after I did a run like this I tried !python export.py --weights runs/train/yolov5s_results/weights/best.pt --img 640 --batch 16 --train --name yolov5s_results, but it doesn't work either. Can you provide a solution for me? thank you in advance |
when testing with best.pt the results obtained are correct, namely sign language detection, but after converting to .tflite form with the command as above, the results obtained are very much different, the detection issued by cars, humans and others. am I doing the conversion wrong sir? |
@nurulamelia2 hello! It's possible that the conversion to tflite did not work as expected. Can you try specifying the input and output shapes of the model explicitly using You can run the following command to specify the input and output shapes of the model explicitly:
Replace Let me know if this helps or if you have any other questions. |
can you help me by looking at my code? i have tried but it still doesn't work. https://colab.research.google.com/drive/1LpPKLf49s46R8O19JzmAgbLyJpqt8Y8x?usp=sharing I'm really confused because I tried several times but the problem was not solved. This assignment is for tomorrow, and I'm still struggling. thank you sir |
@nurulamelia2 hello, I understand that you are having issues with your code and are working with a deadline. However, in order to help you effectively, we need some more information on what exactly is not working. Can you please provide more details on what issue you are facing with your code? In the meantime, I suggest double-checking your code for any syntax errors, ensuring that all necessary libraries are installed and imported correctly, and verifying that your input data is in the correct format for the YOLOv5 model. Also, keep in mind that it's often helpful to approach issues step-by-step and try to isolate the problem. In this case, you could try testing your code on a smaller dataset or verifying that the model architecture itself is working correctly. Please provide more details on the specific issue you are having so that we can best assist you in resolving the problem. Good luck and we look forward to hearing back from you! |
I want to ask again, because I'm still curious. is the cause because the custom data is not read and the coco data is read, so when converting an error occurs. Here is the information when converting export: data=data/coco128.yaml, weights=['/content/yolov5/runs/train/yolov5s_results/weights/best.pt'] is that where the problem lies? |
@nurulamelia2 hello and thank you for reaching out to us. It's possible that the issue is caused by the fact that the exported model is still using the Also, double-check that your custom Please try this and let us know if the issue persists or if you have any other questions. Thank you. |
problem solved, thank you very much. Can this .tflite model be deployed using kotlin programming language? |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLO 🚀 and Vision AI ⭐ |
@nurulamelia2 absolutely! You can deploy the .tflite model using Kotlin or any other programming language that supports TensorFlow Lite. The TensorFlow Lite Android Support Library provides a convenient way to integrate tflite models into Android apps, including those developed in Kotlin. You can find detailed documentation and examples on how to use TensorFlow Lite models in Android apps in the official TensorFlow Lite documentation. If you encounter any hurdles during this process, feel free to reach out to us for further assistance. Good luck with your deployment! |
i have the same issue , i trained a yolov5 model to detect traffic lights and i tested the best.pt model the results are great , but when i converted it to tflite and tested it it's detecting all traffic lights as red light , i also specified --data with the path to my custom .yaml file but still the same issue , any suggestions ? |
how the problem was solved? |
Hello, it's great to hear your issue was resolved! For others experiencing similar challenges, could you please share the steps or adjustments you made to solve the problem? This would be helpful for the YOLO community. Thank you! |
Search before asking
Question
hello, I want to ask. How do you convert best.pt to tflite using yolov5 on google collab? I've tried converting, but after running the result is different.
Additional
No response
The text was updated successfully, but these errors were encountered: