Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to run person_detect.tflite via TFLite benchmark_model #68308

Open
bhbruce opened this issue May 21, 2024 · 3 comments
Open

Fail to run person_detect.tflite via TFLite benchmark_model #68308

bhbruce opened this issue May 21, 2024 · 3 comments
Assignees
Labels
comp:lite TF Lite related issues comp:micro Related to TensorFlow Lite Microcontrollers type:bug Bug

Comments

@bhbruce
Copy link
Contributor

bhbruce commented May 21, 2024

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

97a794b

Current behavior?

There is a TFLite model called person_detect.tflite in tflite-micro https://github.com/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/models/person_detect.tflite.
I cannot run this model via tensorflow's benchmark_model.
It looks like all depthwise_convolutions' quantization_dim meta-data are wrong.

Command to reproduce the issue

`tools/benchmark/benchmark_model  --num_runs=3 --enable_op_profiling=true --num_threads=2 --graph=person_detect.tflite`

Relevant log output

### Error Log 

INFO: STARTING!
INFO: Log parameter values verbosely: [0]
INFO: Min num runs: [3]
INFO: Num threads: [2]
INFO: Graph: [person_detect.tflite]
INFO: Signature to run: []
INFO: Enable op profiling: [1]
INFO: #threads used for CPU inference: [2]
INFO: Loaded model person_detect.tflite
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 33 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 36 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 40 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 44 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 48 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 52 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 56 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 60 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 64 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 68 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 72 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 76 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 80 has invalid quantization parameters.
ERROR: quantized_dimension must be in range [0, 1). Was 3.
ERROR: Tensor 84 has invalid quantization parameters.
ERROR: Failed to initialize the interpreter
ERROR: Benchmarking failed.
@google-ml-butler google-ml-butler bot added the type:bug Bug label May 21, 2024
@tilakrayal tilakrayal added comp:lite TF Lite related issues comp:micro Related to TensorFlow Lite Microcontrollers labels May 21, 2024
@tilakrayal tilakrayal assigned sawantkumar and unassigned tilakrayal May 21, 2024
@sawantkumar
Copy link

hi @bhbruce ,

I will benchmark the model and will get back to you.

@sawantkumar
Copy link

hi @bhbruce ,

I replicated the issue and i got the same error. So its probably a bug in the model's metadata . I will raise a PR to get it fixed. Thank you

@bhbruce
Copy link
Contributor Author

bhbruce commented May 27, 2024

Hi @sawantkumar
Appreciate for confirming it. If you have a PR to fix it, please share it with me.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:lite TF Lite related issues comp:micro Related to TensorFlow Lite Microcontrollers type:bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants