Android app error - input tensor 0 is missing TensorMetadata
I'm trying to get a basic Android app working using the BirdNet model
As per @kahst instructions I've tried to drop the model tflite into the following official TensorFlow Lite example project: https://github.com/tensorflow/examples/tree/master/lite/examples/audio_classification
However on running the app I get an immediate error and crash with the following logs:
org.tensorflow.lite.examples.audio E Error getting native address of native library: task_audio_jni
java.lang.IllegalArgumentException: Error occurred when initializing AudioClassifier: input tensor 0 is missing TensorMetadata.
at org.tensorflow.lite.task.audio.classifier.AudioClassifier.initJniWithModelFdAndOptions(Native Method)
at org.tensorflow.lite.task.audio.classifier.AudioClassifier.access$000(AudioClassifier.java:74)
at org.tensorflow.lite.task.audio.classifier.AudioClassifier$1.createHandle(AudioClassifier.java:143)
at org.tensorflow.lite.task.audio.classifier.AudioClassifier$1.createHandle(AudioClassifier.java:136)
at org.tensorflow.lite.task.core.TaskJniUtils$1.createHandle(TaskJniUtils.java:70)
at org.tensorflow.lite.task.core.TaskJniUtils.createHandleFromLibrary(TaskJniUtils.java:91)
(to confirm, when I use the in-build yamnet/speech models that come with that example, it works fine).
I have seen similar errors when trying to run the model using my own code (though I am not a full-time Android developer so I could be doing something stupid).
Any help/guidance would be appreciated
you can have a look at my project. https://github.com/woheller69/BirdNet-lite-Android I got the TFlite model v2.4 from BirdNET-PI running on Android.
I started wigh an older sound_classification (not audio_classification) example for Tensorflow lite, which was already removed. But GitHub does not forget :-)