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

Convert palm_detection_lite.tflite : ValueError: Tensor data is null. Run allocate_tensors() first #19

Closed
geaxgx opened this issue Nov 29, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@geaxgx
Copy link

geaxgx commented Nov 29, 2021

Issue Type

Bug

OS

Ubuntu

OS architecture

x86_64

Programming Language

Python

Framework

OpenVINO

Download URL for tflite file

https://github.com/google/mediapipe/blob/master/mediapipe/modules/palm_detection/palm_detection_lite.tflite
https://github.com/google/mediapipe/blob/master/mediapipe/modules/palm_detection/palm_detection_full.tflite

Description

Hi @PINTO0309 !
I have just noticed that Goggle has updated the palm detection model a few weeks ago (I missed them because does not appear in release notes). Now there are 2 models (lite and full). Naturally I would like to test them :-)
So after running docker pull ghcr.io/pinto0309/tflite2tensorflow:latest ,
when running:
tflite2tensorflow --model_path palm_detection_lite.tflite --model_output_path palm_detection_lite --flatc_path ../../flatc --schema_path ../../schema.fbs --output_pb --optimizing_for_openvino_and_myriad --rigorous_optimization_for_myriad
I get : ValueError: Tensor data is null. Run allocate_tensors() first

Relevant Log Output

...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ op: DEQUANTIZE
{'builtin_options_type': 'NONE',
 'custom_options_format': 'FLEXBUFFERS',
 'inputs': [68],
 'opcode_index': 9,
 'outputs': [319]}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ op: PRELU
{'builtin_options_type': 'NONE',
 'custom_options_format': 'FLEXBUFFERS',
 'inputs': [121, 319],
 'opcode_index': 1,
 'outputs': [122]}
Traceback (most recent call last):
  File "/usr/local/bin/tflite2tensorflow", line 6402, in <module>
    main()
  File "/usr/local/bin/tflite2tensorflow", line 5759, in main
    TFLite_Detection_PostProcess_flg = make_graph(
  File "/usr/local/bin/tflite2tensorflow", line 877, in make_graph
    alpha_array = interpreter.get_tensor(alpha_detail['index'])
  File "/usr/local/lib/python3.8/dist-packages/tensorflow/lite/python/interpreter.py", line 858, in get_tensor
    return self._interpreter.GetTensor(tensor_index)
ValueError: Tensor data is null. Run allocate_tensors() first

Source code for simple inference testing code

No response

PINTO0309 added a commit that referenced this issue Nov 29, 2021
@PINTO0309 PINTO0309 added the bug Something isn't working label Nov 29, 2021
@PINTO0309
Copy link
Owner

Fixes. PyPI has been updated, but the Docker container will take the remaining 20 minutes to complete the GitHub Action CI.
https://github.com/PINTO0309/tflite2tensorflow/releases/tag/v1.16.2

@PINTO0309
Copy link
Owner

Commited. 😄 Thank you!
https://github.com/PINTO0309/PINTO_model_zoo/tree/main/033_Hand_Detection_and_Tracking/21_new_full_lite

@geaxgx
Copy link
Author

geaxgx commented Nov 29, 2021

Thanks @PINTO0309 !
A quick feedback: the new models work on a 192x192 image vs 128x128 for the older version.
They are significantly slower. On MyriadX (depthai):

  • older: 25ms
  • lite: 44ms
  • full: 52ms

Difficult to judge accuracy on only one test, but this what I get on this image:

  • older:
    snapshot_old

  • lite :
    snapshot_lite

-full:
snapshot_full

Strangely, full is worse than lite on this image. I am not sure yet I will update my hand tracker repo with these models (I am a bit disappointed :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants