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

。_饼干妹妹 提交于 2019-12-01 00:15:58

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.

WilderField

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!