raymond-li / tflite_tensor_outputter

Generates intermediate tensor outputs for tflite
Apache License 2.0
14 stars 6 forks source link

TFLite Tensor Outputter Script

Prerequisites

Usage

Generating the Python Flatbuffer code for the FlatBuffers Schema (tflite.fbs):

flatc --python tflite.fbs

Running the tool to generate files for all the tensors in the model during inference of the input image:

# Using default arguments specified at the beginning of the file
python3.6 tflite_tensor_outputter.py

# Using command line
python3.6 tflite_tensor_outputter.py --image input/dog.jpg --model_file input/inception_v3/inception_v3_quant.tflite --label_file input/inception_v3/labels.txt --output_dir output/layer_outputs_dog_quant/