【发布时间】:2020-03-23 04:48:24
【问题描述】:
import tensorflow as tf
path = "C:/Users/LAWSSSS/Desktop/convert_pb_2_tflite/frozen_inference_graph-SteelRoll.pb"
inputs = ["image_tensor"]
outputs = ["detection_boxes"]
converter = tf.lite.TFLiteConverter.from_frozen_graph(path, inputs, outputs, input_shapes={"image_tensor":[1,640,360,3]})
converter.post_training_quantize = True
tflite_model = converter.convert()
open("frozen_inference_graph-SteelRoll.tflite", "wb").write(tflite_model)
总的来说,我是 Tensorflow 的新手。我尝试使用上面的代码将 .pb 转换为 .tflite。但是,我收到一个错误:
array.data_type == array.final_data_type Array "image_tensor" has mis-matching actual and final data types (data_type=uint8, final_data_type=float).
Fatal Python error: Aborted
我该如何解决这个问题?
【问题讨论】:
标签: python tensorflow tensorflow-lite toco