New Interpreter() resultes App crash

Hi,

I met such issue during use TensorFlow Lite in Android.

Firstly I used my code and it worked.

After about 4 months – July, while try a Git example project, many Android Studio modules/plugins are automatically downloaded/updated. Example project also worked. While returning back to my project, it always crashes while creating new Interpreter.

MappedByteBuffer model = loadModel(pathModel);
Interpreter.Options options = new Interpreter.Options();
options.setNumThreads(1);
this.interpreter = new Interpreter(model, options);

My project uses almost same TensorFlow Lite API with example project. No obvious strange difference is observed about TFLite API. My converted model also runs well with example project. All test are performed with same Phone & OS version.

Other difference observed, after Android Studio change, if “options.addDelegate(new GpuDelegate());” exists, it also crashes.

Example project highest API Level is 28. And uses

    implementation('org.tensorflow:tensorflow-lite:0.0.0-nightly') { changing = true }
    implementation('org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly') { changing = true }
    implementation('org.tensorflow:tensorflow-lite-support:0.0.0-nightly') { changing = true }

Does there anyone meet same problem with me?

@YPK,

Welcome to the Tensorflow Forum,

I see that your are using nightly version. Could you please check with latest stable version (2.13) and let us know? Nightly versions are not stable as the code changes will be done overnight which might result in app crash.

Thank you!