【发布时间】:2021-08-14 03:40:06
【问题描述】:
我们有一个从 CustomVision.ai 导出的模型(它支持导出 TensorFlow .pb、TensorFlow Lite .tflite、Saved Model .pp 格式)。
我们希望将此模型集成到使用 TFLite 对象检测 API 的现有应用程序中,该应用程序需要以下输入和输出:
--input_arrays=normalized_input_image_tensor \
--output_arrays='TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1','TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3' \
模型似乎有非常不同的输入和输出:
Inputs array: Placeholder
name: Placeholder
type: float32[1,416,416,3]
quantization: 0 ≤ q ≤ 255
location: 0
Outputs array: model_outputs
name: model_outputs
type: float32[1,13,13,45]
location: 44
如果我运行“tflite_convert”命令
tflite_convert \
--graph_def_file=model.pb \
--output_file=detect.tflite \
--input_shapes=1,416,416,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=FLOAT \
--allow_custom_ops
我明白了:
ValueError: Invalid tensors 'normalized_input_image_tensor' were found.
知道如何让它工作吗?我整天都在挖,结果只是干了……任何帮助将不胜感激!谢谢!
【问题讨论】:
标签: tensorflow tensorflow-lite object-detection-api microsoft-custom-vision