-
-
Notifications
You must be signed in to change notification settings - Fork 16k
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
AllocateTensors() failed #11772
Comments
👋 Hello @khairulr36, 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 |
@khairulr36 hello, The error message you received - "AllocateTensors() failed" - suggests that there may be an issue when initializing the object detector. Since the error occurred after you converted the model to .tflite format, it is possible that there was an error during the conversion process. To help troubleshoot the issue, could you please provide the following information?
Once we have this information, we'll be better able to assist you in resolving the issue. |
@glenn-jocher This is the information that I can provide :
|
Hello @khairulr36, Thank you for providing the information. It seems that you are using an older version of TensorFlow (2.12.0) which may not be compatible with the YOLOv5 codebase. We recommend using the latest version of TensorFlow (currently 2.6.0) with YOLOv5 to ensure optimal compatibility and performance. Could you please upgrade your TensorFlow version to the latest version and try again with the conversion? Let me know if you need further help. Best, |
@glenn-jocher Based on the data obtained from the TensorFlow website : The latest version of TensorFlow is 2.12.0, released in March 2023. And for TensorFlow 2.6.0, it was released in August 2021. "What else should I do?" |
👋 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 ⭐ |
@khairulr36 I apologize for the confusion. It seems that there was an error in the provided information. It appears that you are already using the latest version of TensorFlow, and that should not be the cause of the issue you are facing. In order to further investigate the "AllocateTensors() failed" issue, we would need some additional details:
With this additional information, we should be able to provide you with a more effective solution. Best, |
Search before asking
Question
I have a problem when I want to change the model Yolov5 from (.pt) to (.tflite). An error message appears on android kotlin
java.lang.IllegalStateException: Error occurred when initializing ObjectDetector: AllocateTensors() failed.
When converting (.pt) to (.tflite) using the code :
!python export.py --weights runs/train/exp/weights/best.pt --include tflite --agnostic-nms
and add the metadata with code :
`ObjectDetectorWriter = object_detector.MetadataWriter
_MODEL_PATH = "best-fp16.tflite"
_LABEL_FILE = "labelmaps.txt"
_SAVE_TO_PATH = "best-fp16_Meta.tflite"
_INPUT_NORM_MEAN = 127.5
_INPUT_NORM_STD = 127.5
writer = ObjectDetectorWriter.create_for_inference(
writer_utils.load_file(_MODEL_PATH), [_INPUT_NORM_MEAN], [_INPUT_NORM_STD],
[_LABEL_FILE])
print(writer.get_metadata_json())
writer_utils.save_file(writer.populate(), _SAVE_TO_PATH)`
is there something wrong?
or
any additional code?
Additional
No response
The text was updated successfully, but these errors were encountered: