onnx2tflite
onnx2tflite copied to clipboard
max error is too big during conversion
Hi author,
Following error rises up during conversion from an onnx to tflite:
ERROR:converter running::tflite model elements' max error has reached 1.4117E+01, but convert is done, please check xx.tflite carefully!
The onnx itself works normally for python. Is there any way to do further debug? Any suggestion is appreciated.
Hello, after the conversion is completed, the tool will compare the output of onnx and tflite for the same set of data. If the maximum element error exceeds 1e-2, an alarm will be issued, but the model is converted successfully. There will be the following situations:
- The tflite model works fine, then you can ignore it.
- The performance of the tfilte model degrades, then you may need to debug layer by layer to find out which layer is causing the error to increase. You can do this by specifying 'output_node_names' before running:
# cutoff model, redefine inputs and outputs, support middle layers
python converter.py --weights "./your_model.onnx" --outpath "./save_path" --formats "tflite" --input-node-names "layer_inputname" --output-node-names "layer_outname1" "layer_outname2"
Thanks for your quick feedback
- The converted tflite does not work normally, i.e, the outputs are incorrect.
- Will try it out.