tensorflow / tflite-support

TFLite Support is a toolkit that helps users to develop ML and deploy TFLite models onto mobile / ioT devices.
Apache License 2.0
369 stars 124 forks source link

tflite-support or tflite_support_nightly are not working on colab #946

Open vankhoa01 opened 1 year ago

vankhoa01 commented 1 year ago

Hi my friends,

I'm using Colab (with python3.10 ) for model training. I tried to use both tflite-support or tflite_support_nightly like this:

Screenshot 2023-09-15 at 1 47 43 PM

But I got this error:

Screenshot 2023-09-15 at 1 47 57 PM

Please give me some solution to fix it if you meet same issue before.

Thank you so much

mldvcco commented 6 months ago

Hi,

+1 I have the same issue. Here is a bit more info.

When executing Colab tutorial for TF Object Detection to TFLite conversion, I bump into below error at Step 3: Add Metadata. Colab link: https://colab.research.google.com/github/tensorflow/models/blob/master/research/object_detection/colab_tutorials/convert_odt_model_to_TFLite.ipynb

from tflite_support.metadata_writers import object_detector

---> 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

We cannot add the metadata in current state.

Here are my TF modules version on Colab: tensorboard 2.15.2 tensorboard-data-server 0.7.2 tensorflow 2.15.0.post1 tensorflow-datasets 4.9.4 tensorflow-estimator 2.15.0 tensorflow-gcs-config 2.15.0 tensorflow-hub 0.16.1 tensorflow-io 0.36.0 tensorflow-io-gcs-filesystem 0.36.0 tensorflow-metadata 1.14.0 tensorflow-model-optimization 0.8.0 tensorflow-probability 0.23.0 tensorflow-text 2.15.0 tensorstore 0.1.45 tf-keras 2.15.0 tf-models-official 2.15.0 tf-slim 1.1.0 tflite-support 0.4.4

If you could please provide a workaround. Thanks!