Error: from mediapipe_model_maker import object_detector

Frst of all, I am quite new for Tensorflow, and try to create custom model based on pre-trained model for Tensorflow Lite.
However, according to several report, TFlite Model Maker does not work on Python.3.10. on Colaboratory. So that I am trying to use Mediapipe Model Maker as suggested in several reports.

Then, I have tried to use Mediapipe Model Maker by following tutorial in the link in below, on Colaboratory.
https://developers.google.com/mediapipe/solutions/customization/object_detector

However errors still happens on the line:
“from mediapipe_model_maker import object_detector”.

The error messages are in below

Could you please anybody help me ?

********** Error messages ***************
/usr/local/lib/python3.10/dist-packages/tensorflow_addons/utils/tfa_eol_msg.py:23: UserWarning: 

TensorFlow Addons (TFA) has ended development and introduction of new features.
TFA has entered a minimal maintenance and release mode until a planned end of life in May 2024.
Please modify downstream libraries to take dependencies from other repositories in our TensorFlow community (e.g. Keras, Keras-CV, and Keras-NLP). 

For more information see: https://github.com/tensorflow/addons/issues/2807 

 
 warnings.warn(
/usr/local/lib/python3.10/dist-packages/tensorflow_addons/utils/ensure_tf_install.py:53: UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.13.0 and strictly below 2.16.0 (nightly versions are not supported). 
 The versions of TensorFlow you are currently using is 2.16.1 and is not supported. 
Some things might work, some things might not.
If you were to encounter a bug, do not file an issue.
If you want to make sure you're using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons's version. 
You can find the compatibility matrix in TensorFlow Addon's readme:
https://github.com/tensorflow/addons
  warnings.warn(
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-a3ff7fc4b833> in <cell line: 7>()
      5 assert tf.__version__.startswith('2')
      6 
----> 7 from mediapipe_model_maker import object_detector

6 frames
/usr/local/lib/python3.10/dist-packages/tensorflow_addons/utils/types.py in <module>
     27     # New versions of Keras require importing from `keras.src` when
     28     # importing internal symbols.
---> 29     from keras.src.engine import keras_tensor
     30 elif Version(tf.__version__).release >= Version("2.5").release:
     31     from keras.engine import keras_tensor

ModuleNotFoundError: No module named 'keras.src.engine'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

Hi,

I got the same error.

It is just frustrating… TFlite Model Maker doesn’t work… Then you get the advise to use Mediapipe… But this also doesn’t work… And now?! The end of the story is to not use tflite or mediapipe…

1 Like