Issue in installing tflite-model-maker in Google Colab

I was trying to install tflite-model-maker in google colab using the below code

!pip install -q tflite-model-maker

!pip install -q tflite-support

but the install runs for ever until the google colab storage becomes full.
Up until a few days back there was no problem. But now i am not able to install it due to this

@ZeauZzz,

Welcome to the Tensorflow Forum!

This is the known issue and team is working on it.

Please refer to the temporary solution here

http://discuss.ai.google.dev/t/tflite-model-maker-installation/16577/5?u=chunduriv

Thank you!

Ohh It worked . ThankYou

Hi, I have same issue with installing model maker in colab. I try fall down the Python version to 3.9.x, but the installation is still not successful. Moreover, after the downgrade, other modules come out of compatibility error. May I know more information about the issue? Thank you.

@Kwok_Wai_Lo,

Welcome to the Tensorflow Forum!

I try fall down the Python version to 3.9.x, but the installation is still not successful

I just tested the Image classification with TensorFlow Lite Model Maker tutorial using colab’s fallback runtime and it works as intended.

Moreover, after the downgrade, other modules come out of compatibility error.

You can safely ignore compatibility issues as long as you can execute and complete the task. Otherwise, you should install the corresponding package using pip.

Thank you!

Facing the same issue and unfortunately, even after using fallback runtime, the Python version appears to be 3.10. Any fixes??

1 Like

This work around no longer works as its post mid May. Is there a fix for this?

Ya what to do about this Fallback runtine version is not available. So how to run it?

@ZeauZzz, @sobryan,

Sorry for the late response.

You can try to use the MediaPipe Model Maker

For more details, please refer to the Object detection model customization guide

Thank you!

Hello, is this a permanent solution? Or are you still working on the installation problem with tflite model maker? It would be nice if that would work again. Thank you for your answer.

1 Like

@Christian_Arends,

Welcome to the Tensorflow Forum!

No, A new release of TFLite Model Maker is coming soon to fix the issue.

MediaPipe Model Maker is evolved from TFLite Model Maker and is the next generation on-device training tool.

Thank you!

Hello @chunduriv, running the example you provided for mediapipe model maker give me this error:

Traceback (most recent call last):
  File "c:/Users/froze/Desktop/poutses/kapota.py", line 1, in <module>
    from mediapipe_model_maker import object_detector
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\mediapipe_model_maker\__init__.py", line 17, in <module>
    from mediapipe_model_maker.python.vision import image_classifier
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\mediapipe_model_maker\python\vision\image_classifier\__init__.py", line 16, in <module>
    from mediapipe_model_maker.python.vision.image_classifier import dataset
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\mediapipe_model_maker\python\vision\image_classifier\dataset.py", line 21, in <module>
    import tensorflow_datasets as tfds
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_datasets\__init__.py", line 43, in <module>
    import tensorflow_datasets.core.logging as _tfds_logging
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_datasets\core\__init__.py", line 22, in <module>
    from tensorflow_datasets.core import community
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_datasets\core\community\__init__.py", line 18, in <module>
    from tensorflow_datasets.core.community.huggingface_wrapper import mock_builtin_to_use_gfile
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_datasets\core\community\huggingface_wrapper.py", line 31, in <module>
    from tensorflow_datasets.core import dataset_builder
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_datasets\core\dataset_builder.py", line 34, in <module>
    from tensorflow_datasets.core import dataset_info
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_datasets\core\dataset_info.py", line 47, in <module>
    from tensorflow_datasets.core import file_adapters
  File "C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tensorflow_datasets\core\file_adapters.py", line 29, in <module>
    from array_record.python import array_record_module
ImportError: cannot import name 'array_record_module' from 'array_record.python' (C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\array_record\python\__init__.py)

I tried with multiple python versions

@Mihail,

Can you try with !pip install tensorflow-datasets==4.8.3 and let us know?

Thank you!

@chunduriv it now says

Traceback (most recent call last):
  File "c:\Users\froze\Desktop\poutses\kapota.py", line 1, in <module>
    from mediapipe_model_maker import object_detector
ImportError: cannot import name 'object_detector' from 'mediapipe_model_maker' (C:\Users\froze\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mediapipe_model_maker\__init__.py)

I wonder if it is because im using tf-nightly. Im forced to use it cause the normal one doesnt detect my gpu

UPDATE: tested it with normal tf, error remains

@Mihail,

As this problem relates to mediapipe_model_maker, would you kindly create a new issue with the standalone code? so that it is easy to followup.

Thank you!

1 Like

@chunduriv opened here for future reference http://discuss.ai.google.dev/t/error-running-mediapipe-model-maker/17699

Is the installation issue of tflite-mode-maker in Google Colab is resolved? Please reply

@chunduriv solution no longer working

@iamthedankness, @Bijoy_Kumar_Upadhyay,

The issue still exists. You can try the workaround as suggested in 60431#issuecomment by @ tomkuzma

Even though you can make a conda environment in colab, it will still always use the colab runtime python version. But you can force it to use the environment by using a bash script and activate it every time you need to use it. Unfortunately this means that you can’t use cells for python code, but instead you can just have it run a python file with all the code you need to use.

I’ve got it working in this notebook. There was a few dependencies like numpy that needed a specific version installation, but after that it was working and training as you can see in the screenshot. Just make your own python file to run for training and you should be good to go.

Google Colab

Thank you!

1 Like

Is there any timeline when the fix will be coming?