Tool for onnx->keras or onnx->tflite. If tool is useful for you, please star it.
PythonMIT
ONNX->Keras and ONNX->TFLite tools
How to use
# basepythonconverter.py--weights"./your_model.onnx"# give save pathpythonconverter.py--weights"./your_model.onnx"--outpath"./save_path"# save keras modelpythonconverter.py--weights"./your_model.onnx"--outpath"./save_path"--formats"keras"# save tflite modelpythonconverter.py--weights"./your_model.onnx"--outpath"./save_path"--formats"tflite"# save keras and tflite modelpythonconverter.py--weights"./your_model.onnx"--outpath"./save_path"--formats"tflite""keras"# quantitative model weight, only weightpythonconverter.py--weights"./your_model.onnx"--formats"tflite"--weigthquant# quantitative model weight, include input and output## recommendpythonconverter.py--weights"./your_model.onnx"--formats"tflite"--int8--imgroot"./dataset_path"--int8mean000--int8std111## generate random data, instead of read from image filepythonconverter.py--weights"./your_model.onnx"--formats"tflite"--int8
注意(Caution)
please use comfirm_acc.py comfirm output is correct after convertion, because some of methods rely on practice.
comfirm_acc.py only support tflite, and tflite should not be any quantification.
only support 2D CNN, may be support more types of CNN or transformer in the future.