将Tensorflow模型转换为Tensorflow Lite

时间:2019-01-09 13:12:38

标签: python tensorflow tensorflow-lite

我将张量流模型转换为tflite时遇到问题。 我有一个基于Tensorflow Object Detection的学习模型 我想使用TFlite converter

中的转换代码
curl https://storage.googleapis.com/download.tensorflow.org/models/mobilenet_v1_0.50_128_frozen.tgz | tar xzv -C /tmp

tflite_convert \
 --output_file=/tmp/foo.tflite \
 --graph_def_file=/tmp/mobilenet_v1_0.50_128/frozen_graph.pb \
 --input_arrays=input \
 --output_arrays=MobilenetV1/Predictions/Reshape_1

我不知道从哪里获得input_arrays和output_arrays的值。

感谢答案

2 个答案:

答案 0 :(得分:0)

我们在对象检测API中有a script来获取Flatbuffer。

答案 1 :(得分:0)

如果您从here下载模型,那么将有一个文件mobilenet_v1_0.5_128_info.txt来说明输入和输出名称

Model: mobilenet_v1_0.5_128
Input: input
Output: MobilenetV1/Predictions/Reshape_1