如何知道 Tensorflow Lite 模型的输入/输出特征信息? [英] How to know Tensorflow Lite model's input/output feature info?
问题描述
我是移动开发人员.我想在 MLKit中使用各种 Tensorflow Lite 模型(.tflite
)一>.
I'm mobile developer. And I want to use various Tensorflow Lite models(.tflite
) with MLKit.
但是有一些问题,我不知道如何知道.tflite
模型的输入/输出特征信息(这些将是设置参数).
But there are some issues, I have no idea of how to know .tflite
model's input/output feature info(these will be parameters for setup).
有什么办法知道吗?
抱歉英语不好,谢谢.
更新(18.06.13.):
Update(18.06.13.):
我发现这个网站 https://lutzroeder.github.io/Netron/.此可视化图基于您上传的模型(如 .mlmode
或 .tflite
等)并找到输入/输出形式.
I found this site https://lutzroeder.github.io/Netron/.
This visualize graph based on your uploaded model(like .mlmode
or .tflite
etc.) and find input/output form.
这是示例截图!https://lutzroeder.github.io/Netron 示例
推荐答案
如果您已经有一个不是自己生产的 tflite 模型,并且您想要查看 tflite 文件并了解您的输入和输出,您可以使用 flatc
工具并转换模型到 .json
文件并阅读.
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.
首先克隆 flatbuffers 仓库并构建 flatc.
First clone the flatbuffers repo and build flatc.
git clone https://github.com/google/flatbuffers.git
然后你必须将 tensorflow schema.fbs 存储在本地.结帐 tensorflow github 或下载一个文件.然后你可以运行 flatc
来生成 json
文件,然后输入 tflite 模型.
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
这将创建一个易于阅读的 input_model.json
文件.
This will create a input_model.json
file that can be easily read.
这篇关于如何知道 Tensorflow Lite 模型的输入/输出特征信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!