android / android/codelab-mlkit-android

mobilenet_v1_1.0_224_quant.tflite vs mobilenet_v1_1.0_224.tflite for inference

Open
#34 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
186
Forks
104
PR merge metrics
No merged PRs in 30d

Description

In "Identify objects in images using custom machine learning models with ML Kit for Firebase" tutorial https://codelabs.developers.google.com/codelabs/mlkit-android-custom-model/index.html?index=..%2F..index#1

There is a step to unpack the downloaded zip file. This will unpack a root folder (mobilenet_v1_1.0_224_quant) inside which you will find the Tensor Flow Lite custom model we will use in this codelab (mobilenet_v1_1.0_224_quant.tflite).

It looks like mobilenet_v1_1.0_224_quant.tflite can run inference with no problem. However, If I download mobilenet_v1_1.0_224.tflite from mobilenet_v1_1.0_224 https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md, Inference get stuck at
val inferenceOutput = it.result?.getOutput>(0)!!

Is there a reason why mobilenet_v1_1.0_224.tflite does not work for the current code base for inference and how to update the current code base to get mobilenet_v1_1.0_224.tflite working?

Contributor guide

Open the contributing guide

Research direction

Start with the inference code in the linked ML Kit for Firebase Android codelab, especially the call to getOutput>(0), and compare it with the two MobileNet TFLite model variants. Reproduce the stall using mobilenet_v1_1.0_224.tflite and determine the expected output type and model compatibility. Done means the codelab explains the difference and the non-quantized model can complete inference, or clearly documents why it is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, tensorflow
Domain
machine-learning, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.