TFLite Model Maker installation

Good day,

I tried tflite-model-maker before, and it was working fine however, recently I’ve been encountering an error when tried installing the tflite-model-maker in colab.
ERROR: Could not find a version that satisfies the requirement tflite-support>=0.4.2 (from tflite-model-maker) (from versions: 0.1.0a0.dev3, 0.1.0a0.dev4, 0.1.0a0.dev5, 0.1.0a0, 0.1.0a1)
ERROR: No matching distribution found for tflite-support>=0.4.2 (from tflite-model-maker)
ERROR: Could not find a version that satisfies the requirement opencv-python-headless==4.1.2.30 (from versions: 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.15.55, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66, 4.7.0.68, 4.7.0.72)
ERROR: No matching distribution found for opencv-python-headless==4.1.2.30

May I know how I can fix this? Every time I run it again, the error changes among tflite-support → scann → numba → goes back to tflite-support.

@ajo,

Thank you for reporting the issue. We will check and get back to you.

1 Like

@ajo,

According to Colab Updated to Python 3.10:

Colab’s fallback runtime version: Using the fallback runtime version temporarily allows access to the Python 3.9 runtime, and will be available until mid-May. This is available from the Command Palette via the Use fallback runtime version command when connected to a runtime. Of note, this setting does not persist across sessions — the command will need to be invoked on each new session.

As a temporary workaround, you can use the Colab fallback runtime version option to choose Python 3.9 and install tflite-model-maker. By doing this you will get RuntimeError and it can be ignored.

To access the command palette in Colab, presss cmd+shift+P and then type Use fallback runtime version and select it.

By following the above process, i am successfully able to execute Model Maker Image Classification Tutorial.

Thank you!

1 Like

Thank you very much it seems to be running now.

Will this be resolved in time for fallback to expire in mid may?

1 Like

OMG! Thank you so much

1 Like

hi, I encountered the same problem and the temporary fix to use Python 3.9 runtime is already unavailable in May 24. Is there any way I can use the command !pip install -q tflite-model-maker?

1 Like

i have the same problem the temporary fix to use Python 3.9 runtime is already unavailable. is there any other solution ??

@wifek_maghraoui @18219102_Kristofer_H ,

TF Lite development team are working on it.

You can try to use the MediaPipe Model Maker.

Thank you!

1 Like

Does MediaPipe support EfficientDet-Lite custom training?

Hi, Can you please tell me how much time this issue takes to get fixed?

Are there any timelines/thread we can follow to keep updated with this?

Guys, I am happy to inform you that you can use virtual environment for installing tflite-model-maker
I didn’t find how to use it in colab notebook, but you can use bash commands for installation and trainining models (put your code in .py and run python code.py) , anyway it’s better than nothing.

python3.8 -m virtualenv venv
virtualenv --python=/usr/bin/python3.8 liteenv
source liteenv/bin/activate
pip install --upgrade pip==20.1.1
pip install tensorflow==2.8.0
git clone https://github.com/tensorflow/examples
cd examples/tensorflow_examples/lite/model_maker/pip_package
pip3 install -e .

// fix some dependencies. may differ for you 
pip3 install protobuf==3.20.0 numpy==1.20.3

Hello thank you for updating the solution. Have you tried training custom model after this fix. If yes please share the steps here.

how much time did it take after using the command palette ??

I have tried to use MediaPipe Model Maker by following tutorial on Google Colabo…
I could install mediapipe-model-maker by “!pip install mediapipe-model-maker”.
But…Error happens following command
“from mediapipe_model_maker import object_detector”

Ref)
Topic: #23693