I am facing a persistent issue with using TensorFlow 2.8.4 and Python 3.8.16 to train my TFLite models. So far, I have been able to successfully train my models and obtain my TFLite models. However, when I try to use them on Android, I receive the following error: "java.lang.AssertionError: Error occurred when initializing ObjectDetector: Output tensor at index 0 is expected to have 3 dimensions, found 2."
This error is related to the version of TensorFlow and TFLite that I am using.
I have attempted to resolve this issue by switching to a virtual environment with Conda, using Python 3.8, TensorFlow 2.5, and TFLite_Model_Maker 0.3.2. These versions worked for my initial training, but now I am encountering an error related to library updates: "Error: policy = tf.keras.mixed_precision.experimental.Policy(precision) AttributeError: module 'keras.api._v2.keras.mixed_precision' has no attribute 'experimental'."
This error is related to using TensorFlow 2.5 and TFLite_Model_Maker 0.3.2 with newer Keras libraries.
Therefore, I am looking for a solution to use the latest versions of TensorFlow and TFLite_Model_Maker while avoiding these errors related to library versions. My goal is to be able to use my TFLite models on Android without encountering these issues.
Thank you in advance for any help you can provide.
I tried to use TFLite models on androide