【发布时间】:2020-07-20 13:24:51
【问题描述】:
我想在 Tensorflow 中将整数量化 tflite 模型转换为 冻结图 (.pb)。我在 StackOverflow 上通读并尝试了许多解决方案,但都没有奏效。具体来说,toco 不起作用(output_format 不能是 TENSORFLOW_GRAPHDEF)。
我的最终目标是通过tf2onnx得到一个量化的ONNX模型,但是tf2onnx不支持tflite作为输入(只支持save_model、checkpoint和graph_def)。但是,使用 TFLiteConverter 对训练好的模型进行量化后,它只返回一个 tflite 文件。这就是问题出现的地方。
理想的流程本质上是这样的:float32 中的 tf 模型 -> int8 中的 tflite 模型 -> graph_def -> onnx 模型。我被第二个箭头卡住了。
【问题讨论】:
标签: tensorflow quantization onnx tensorflow-lite