3

我有一个 tflite 模型,我想将其转换为 tensorflow 或 keras 或 ONNX 格式。有办法吗?

我可以使用 tf 解释器导入它并在 python 上运行它。但是我想将其转换为上述格式之一。

import tensorflow as tf
interpreter = tf.lite.Interpreter(model_path="conv_actions_frozen.tflite")
tensors = interpreter.get_tensor_details()
4

1 回答 1

0

现在有转换器可以将 tflite 模型转换为 onnx 格式。安装 tflite2onnx 库。您所要做的就是:

import tflite2onnx

tflite_path = "path/to/the/tflitemodel"
onnx_path = "path/where/you/want/to/save/your/model" #modelname.onnx


tflite2onnx.convert(tflite_path,onnx_path)
于 2021-03-23T10:09:48.193 回答