1

我是 Tensorflow 的新手,我正在尝试转换pbtflite但是当我使用这个命令时

tflite_convert --graph_def_file=graph\tflite_graph.pb --output_file=output.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=128 \
--change_concat_input_ranges=false --allow_custom_ops

我收到这个错误

> Check failed: GetOpWithOutput(model, output_array) Specified output array "'TFLite_Detection_PostProcess'" is not produced by any op in this graph. Is it a typo? This should not happen. If you trigger this error please send a bug report (with code to reproduce this error), to the TensorFlow Lite team.

请帮我。

4

1 回答 1

0

首先,您使用 export_tflite_ssd_graph.py 进行转换。注意 max_detections 以获得良好的移动性能。

python export_tflite_ssd_graph.py --input_type image_tensor --pipeline_config_path training_ssd_v2_config --trained_checkpoint_prefix ../output/model.ckpt-124960 --output_directory ../output/frozen_tflite/frozen_inference_graph.pb -add_postprocessing_op True --max_detections 10

其次,将 tflite_convert 与 tensorflow(或 tensorflow-gpu)1.11 版一起使用:

tflite_convert --output_file=./tflite/detect.tflite
--graph_def_file=/home/nguyen/ssd/Foods/dataset/OD_food_non_food/ssd_model/output/frozen_tflite/frozen_inference_graph.pb/tflite_graph.pb
--input_arrays=normalized_input_image_tensor
--output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3'
--input_shape=1,300,300,3
--allow_custom_ops

也看看这些链接

于 2019-10-17T08:06:02.517 回答