Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is there incompatibility between Auto ML Vision Vertex AI and ML Kit ?

Hello, I am developing an app in Android/kotlin.
The app must make use of the ML Kit for object detection.
I have added these dependencies for ML Kit:

implementation 'com.google.mlkit:object-detection:17.0.1'
implementation 'com.google.mlkit:object-detection-custom:17.0.1'

I have trained an AutoML model for object detection on Vertex AI but when I try to use the .tflite file in my app, I receive the error:

"Unexpected number of dimensions for output index 0: got 3D, expected either 2D (BxN with B=1) or 4D (BxHxWxN with B=1, W=1, H=1)"

I have saved the .tflite file in the assets folder.
This is the code that should call the model:

val localModel = LocalModel.Builder()
.setAssetFilePath("my-model.tflite")
.build()

It would be astonishing if there was really incompatibility between an AutoML Vision generated tflite file and ML Kit. Could you please clarify the issue ? Thank you

0 6 619
6 REPLIES 6