将TensorFlow冻结图转换为Lite模型?

时间:2020-03-27 08:04:33

标签: python tensorflow

我对TensorFlow相当陌生,但是设法获得了冻结的图表。现在,此图仍必须使用精简模型。做这个的最好方式是什么?我使用 ssd_mobilenet_v2_quantized_300×300 作为训练模型。

我已经转换了冻结的图,但是输出效果不是很好。我认为可以对模型进行检测,但是绘制的检测框不正确。

我使用此命令将图形转换为 TensorFlow Lite 模型:

Tflite_convert \ 
--graph_def_file=tflite_graph.pb \ 
--output_file=detect.tflite \ 
--output_format=TFLITE \ 
--input_shapes=1,300,300,3 \ 
--input_arrays=normalized_input_image_tensor \ 
--output_arrays=TFLite_Detection_PostProcess,TFLite_Detection_PostProcess:1,TFLite_Detection_PostProcess:2,TFLite_Detection_PostProcess:3 \ 
--inference_type=QUANTIZED_UINT8 \ 
--mean_values=128 \ 
--std_dev_values=127 \ 
--change_concat_input_ranges=false \ 
--allow_custom_ops

我已经在 Windows 10 上对模型进行了训练,视觉输出为: Output trained model on Windows 10

但是当我使用转换后的模型时,我得到以下输出: Output converted model to TensorFlow Lite

我正在使用 TensorFlow 1.15.0 我还使用Raspberry Pi执行TensorFlow Lite和Lite模型。

所以我的问题是:你们知道问题是什么或如何找到它吗?

提前谢谢

0 个答案:

没有答案