``向tflite SSD_MobileNet_V2隐蔽PB时出错-Windows 10

时间:2019-10-08 07:43:28

标签: tensorflow tensorflow-lite mobilenet

我是Tensorflow的新手 我正在尝试将pb转换为tflite,但是当我使用此命令时

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.

请帮助我。

1 个答案:

答案 0 :(得分: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

也请看一下这些链接

相关问题