0

I like to test the Object Detection Example of TFLite.

https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android

The example with the default Model works great. But I want to test a custom Model generated from AutoML. When I am replace the "detect.tflite" and "labelmap fille" in the "\src\main\assets" directory and build then the App crashes after launch.

My Model is very simple ... can detect only 2 objects (Tiger and Lion). And my labelmap file contains below:

??? Tiger Lion

Also I comment the line "//apply from:'download_model.gradle'" in "build.gradle" to stop the download of default Model and use my custom Model from asset.

I new in both Android and this ML space. I'll be glad if anyone can advise for App crash after launch with custom AutoML Model.

Thanks in advance.

Regards.

EDAS
  • 11
  • 2
  • You should provide more detail as to where/what is the AutoML model file generated (perhaps a link to source). Realize that Tensorflow Lite only knows about `.tflite` files. – Morrison Chang Jan 22 '20 at 05:23
  • Hi yes sure. In google AutoML platform ... it provides GUI to generate Models with zero coding. Where I uploaded all of my images, make Bounding Box and start Training (by selecting Edge). After few Hr training is over and I can download my model file in .tflite format This .tflite file I used in Android Studio Object detection example but the App crashes after launch. – EDAS Jan 22 '20 at 06:20
  • 1
    I would double check that your input and output vectors match any Android app you are replacing the default model in. Otherwise you should show what is crashing, logcat etc. – Morrison Chang Jan 22 '20 at 06:27

1 Answers1

0

Two probable errors on log might be:

Cannot convert between a TensorFlowLite buffer with 1080000 bytes and a ByteBuffer with 270000 bytes. Modify TF_OD_API_INPUT_SIZE accordingly.

tflite ml google [1, 20, 4] and a Java object with shape [1, 10, 4]. Modify NUM_DETECTIONS according to custom model.

David
  • 1
  • 2