PINTO0309 / tflite2tensorflow

Generate saved_model, tfjs, tf-trt, EdgeTPU, CoreML, quantized tflite, ONNX, OpenVINO, Myriad Inference Engine blob and .pb from .tflite. Support for building environments with Docker. It is possible to directly access the host PC GUI and the camera to verify the operation. NVIDIA GPU (dGPU) support. Intel iHD GPU (iGPU) support. Supports inverse quantization of INT8 quantization model.
https://qiita.com/PINTO
MIT License
262 stars 41 forks source link

TypeError: Interpreter._get_tensor_details() missing 1 required positional argument: 'subgraph_index' #43

Closed zhenhao-huang closed 4 months ago

zhenhao-huang commented 4 months ago

Issue Type

Feature Request

OS

Ubuntu

OS architecture

x86_64

Programming Language

Python

Framework

TensorFlow, TensorFlowLite

Download URL for tflite file

https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_full/float16/latest/pose_landmarker_full.task download task file and upzip,will get pose_detection.tflite and pose_landmark_full.tflite.

Convert Script

/home/qdwl/.local/bin/tflite2tensorflow --model_path pose_landmark_full.tflite --flatc_path ../flatbuffers/build/flatc --schema_path ../schema.fbs --output_pb

Description

Both tflite files failed to convert

Relevant Log Output

{'dtype': <class 'numpy.float32'>,
 'index': 0,
 'name': 'input_1',
 'quantization': (0.0, 0),
 'quantization_parameters': {'quantized_dimension': 0,
                             'scales': array([], dtype=float32),
                             'zero_points': array([], dtype=int32)},
 'shape': array([  1, 256, 256,   3], dtype=int32),
 'shape_signature': array([  1, 256, 256,   3], dtype=int32),
 'sparsity_parameters': {}}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ op: PAD
{'builtin_options': {},
 'builtin_options_type': 'PadOptions',
 'custom_options_format': 'FLEXBUFFERS',
 'inputs': [0, 2],
 'opcode_index': 0,
 'outputs': [203]}
Traceback (most recent call last):
  File "/home/qdwl/.local/bin/tflite2tensorflow", line 819, in make_graph
    paddings_array = tensors[op['inputs'][1]]
                     ~~~~~~~^^^^^^^^^^^^^^^^^
KeyError: 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/qdwl/.local/bin/tflite2tensorflow", line 6614, in <module>
    main()
  File "/home/qdwl/.local/bin/tflite2tensorflow", line 5881, in main
    TFLite_Detection_PostProcess_flg = make_graph(
                                       ^^^^^^^^^^^
  File "/home/qdwl/.local/bin/tflite2tensorflow", line 821, in make_graph
    paddings_detail = interpreter._get_tensor_details(op['inputs'][1])
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Interpreter._get_tensor_details() missing 1 required positional argument: 'subgraph_index'

Source code for simple inference testing code

No response

PINTO0309 commented 4 months ago

Dup: https://github.com/PINTO0309/tflite2tensorflow/issues/42