How to know Tensorflow Lite model's input/output feature info?

后端 未结 2 1719
旧时难觅i
旧时难觅i 2021-01-05 08:35

I\'m mobile developer. And I want to use various Tensorflow Lite models(.tflite) with MLKit.

But there are some issues, I have no idea of how to know <

2条回答
  •  情话喂你
    2021-01-05 09:33

    Adding to the above answer:

    See these instructions for building:

    https://google.github.io/flatbuffers/md__building.html

    If you already have a tflite model that you did not produce yourself, and you want to look inside the tflite file and understand your inputs and outputs, you can use flatc tool and convert the model to .json file and read that.

    First clone the flatbuffers repo and build flatc.

    git clone https://github.com/google/flatbuffers.git

    Then you have to have the tensorflow schema.fbs stored locally. Either checkout the tensorflow github or download that one file. Then you can run flatc to generate the json file from then input tflite model.

    flatc -t schema.fbs -- input_model.tflite
    

    This will create a input_model.json file that can be easily read.

提交回复
热议问题