Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android MLKit - Internal error has occurred when executing Firebase ML tasks

Tags:

Hi I have a custom model that im using in an android app, how ever when i try to run it, an MLkitExceptions is thrown, the log output for said error is the following:

Internal error has occurred when executing Firebase ML tasks

My java code for my app looks like the following:

FirebaseLocalModel localModel = new FirebaseLocalModel.Builder("local_places_recommend")
                .setAssetFilePath("recsys.tflite").build();

FirebaseModelManager.getInstance().registerLocalModel(localModel);



FirebaseModelOptions options = new FirebaseModelOptions.Builder()
                .setLocalModelName("local_places_recommend")
                .build();

FirebaseModelInterpreter firebaseInterpreter = FirebaseModelInterpreter.getInstance(options);

FirebaseModelInputOutputOptions inputOutputOptions =
       new FirebaseModelInputOutputOptions.Builder()
                .setInputFormat(0, FirebaseModelDataType.FLOAT32, new int[]{1, 3})
                .setOutputFormat(0, FirebaseModelDataType.FLOAT32, new int[]{1, 1, 34})
                .build();

float[][] input = new float[1][3];

input[0][0] = d1;
input[0][1] = d2;
input[0][2] = d3;


FirebaseModelInputs inputs = new FirebaseModelInputs.Builder()
                .add(input)
                .build();

whenever i try to run the FirebaseModelInterpreter I get that error and nothing else.

The shape of the input tensor and output tensor are the following respectively:

[1 3]
<class 'numpy.float32'>
[ 1  1 34]
<class 'numpy.int64'>

Any help or insight about this issue would be gladly appreciated.