«Ошибка при конвертации pb в tflite SSD_MobileNet_V2 - Windows 10 - PullRequest
1 голос
/ 08 октября 2019

Я новичок в 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 голосов
/ 17 октября 2019

Сначала вы конвертируете, используя 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 с tenorflow (или тензор-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

Также посмотрите на этиссылки

...