Im trying to implement my custom ML model in a kotlin app.
I first make and train my model in GCP Vertex AI. After my model was ready i've export it as tensor flow model to the edge and then upload to my Firebase Machine Learning proyect.
After that i follow the guide to implement a custom model of tensor flow lite on android.
Then when i execute my app it crash on this part of the code:
val conditions = CustomModelDownloadConditions.Builder()
.requireWifi() // Also possible: .requireCharging() and .requireDeviceIdle()
.build()
FirebaseModelDownloader.getInstance()
.getModel("your_model", DownloadType.LOCAL_MODEL_UPDATE_IN_BACKGROUND,
conditions)
.addOnSuccessListener { model: CustomModel? ->
// Download complete. Depending on your app, you could enable the ML
// feature, or switch from the local model to the remote model, etc.
// The CustomModel object contains the local path of the model file,
// which you can use to instantiate a TensorFlow Lite interpreter.
val modelFile = model?.file
if (modelFile != null) {
interpreter = Interpreter(modelFile) // this line crash
}
}
More specific at the line "interpreter = Interpreter(modelFile)". I get the following exception:
java.lang.IllegalStateException: Internal error: Unexpected failure when preparing tensor allocations: Encountered unresolved custom op: edgetpu-custom-op. See instructions: https://www.tensorflow.org/lite/guide/ops_custom Node number 0 (edgetpu-custom-op) failed to prepare.
What is the meaning of this error? How can i solve it?