Getting the error : Internal error has occurred when executing Firebase ML tasks

438 views
Skip to first unread message

Ron ryan

unread,
Dec 19, 2019, 9:54:54 AM12/19/19
to Firebase Google Group
I am trying to make an image classification android app with a custom model through Firebase.

But when i try to run the interpreter, It fails and gives me this error.
I cross checked the input-output dimensions. What can I do
Please Help Me!.

public List<Recogonition> recImg(Bitmap bm) {
    bm.createScaledBitmap(bm, 224, 224, false);


    int batchNum = 0;
    float[][][][]input = new float[1][224][224][3];
    for (int x = 0; x < 224; x++) {
        for (int y = 0; y < 224; y++) {
            int pixel = bm.getPixel(x, y);
            input[batchNum][x][y][0] = (Color.red(pixel) - 127) / 128.0f;
            input[batchNum][x][y][1] = (Color.green(pixel) - 127) / 128.0f;
            input[batchNum][x][y][2] = (Color.blue(pixel) - 127) / 128.0f;
        }
    }


    FirebaseModelInputs
            inputs = null;
    try {
        inputs = new FirebaseModelInputs.Builder().add(input).build();
        System.out.println("________ INPUT DONE ___________");
    } catch (FirebaseMLException e) {
        e.printStackTrace();
        System.out.println("INPUT ERROR ___________");
    }
    System.out.println("______RUNNING__________");

        interpreter.run(inputs, inoutOptions).addOnSuccessListener(new OnSuccessListener<FirebaseModelOutputs>() {
            public void onSuccess(FirebaseModelOutputs result) {
                float[][] results = new float[1][5];
                results = result.getOutput(0);
                probs = results[0];
                Log.i("tag","________ProBS__"+probs);
                System.out.println("______ RAN __________");
            }

        }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                System.out.println("___ Run Error__"+e);
            }
        });



Kato Richardson

unread,
Dec 23, 2019, 11:47:36 AM12/23/19
to Firebase Google Group
Hi Ron,

I think you forgot to include "this error"?

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/d295b1b4-5e3a-427a-8871-d2a9e994e6e7%40googlegroups.com.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages