我想将整数量化的tflite模型转换为 Tensorflow 中的冻结图(.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 模型。我被困在第二个箭头上。