YOLOv9 model export as tflite model #10572
Replies: 3 comments 1 reply
-
Hello! It seems like you're facing a conflict issue during the TFLite export process, often due to package version mismatches. A quick workaround to try in Colab is to restart the runtime and ensure you're using compatible versions of the packages involved in the conversion process ( For instance: !pip install tensorflow==2.6.0 onnx onnx-tf After installing or upgrading, make sure to restart the Colab runtime:
Then, attempt the export process again: from ultralytics import YOLO
# Load the YOLOv9 model
model = YOLO('/content/runs/detect/train2/weights/best.pt')
# Export the model to TFLite format
model.export(format='tflite') If issues persist, checking the specific versions of the packages involved for known compatibility issues could provide further insights. 🛠️ |
Beta Was this translation helpful? Give feedback.
-
Hello! It seems like you're facing a conflict issue during the TFLite export process, often due to package version mismatches, especially when working on Colab which dynamically updates packages. A quick fix could be to refresh your Colab environment packages. Try the following steps:
from ultralytics import YOLO
# Load your YOLOv9 model
model = YOLO('/content/runs/detect/train2/weights/best.pt')
# Attempt to export again
model.export(format='tflite') If issues persist, it could be helpful to share the exact version of TensorFlow installed and any additional export settings you might be using. Keeping a close eye on package versions can be critical in these situations. 🛠️ Let us know how it goes! |
Beta Was this translation helpful? Give feedback.
-
hai @pderrenger , implementation ("org.tensorflow:tensorflow-lite:2.14.0") I tried these but i am getting model load error.then i tried implementation ("org.tensorflow:tensorflow-lite:2.16.2") Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'. |
Beta Was this translation helpful? Give feedback.
-
I am trying to export yolov9 model as tflite model but got error. Please guide me(I am using colab )
Load the YOLOv9 model
model = YOLO('/content/runs/detect/train2/weights/best.pt')
Export the model to TFLite format
model.export(format='tflite') # creates '.tflite'
and error
ONNX: export success ✅ 6.0s, saved as '/content/runs/detect/train2/weights/best.onnx' (96.9 MB)
TensorFlow SavedModel: starting TFLite export with onnx2tf 1.17.5...
TensorFlow SavedModel: export failure ❌ 26.7s: generic_type: cannot initialize type "StatusCode": an object with that name is already defined
ImportError Traceback (most recent call last)
in <cell line: 4>()
2 model = YOLO('/content/runs/detect/train2/weights/best.pt')
3 # Export the model to TFLite format
----> 4 model.export(format='tflite') # creates 'yolov8n_float32.tflite'
11 frames
/usr/local/lib/python3.10/dist-packages/tensorflow_lite_support/python/task/vision/core/tensor_image.py in
17
18 from tensorflow_lite_support.python.task.vision.core import color_space_type
---> 19 from tensorflow_lite_support.python.task.vision.core.pybinds import image_utils
20
21
ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined
Beta Was this translation helpful? Give feedback.
All reactions