keras-onnx: Convert your Keras model into ONNX

keras-onnx enables you to convert models from keras toolkits into ONNX.

Issues, questions

You should look for existing issues or submit a new one. Sources are available on onnx/keras-onnx.

ONNX version

If you want the converted model is compatible with certain ONNX version, please specify the target_opset parameter on invoking convert function, and the following Keras converter example code shows how it works.


keras-onnx converts models in ONNX format which can be then used to compute predictions with the backend of your choice. However, there exists a way to automatically check every converter with onnxruntime, onnxruntime-gpu. Every converter is tested with this backend.

Related converters

keras-onnx converts models from scikit-learn. It was initially part of onnxmltools which can still be used to convert models for xgboost and libsvm. Other converters can be found on github/onnx, torch.onnx, ONNX-MXNet API, Microsoft.ML.Onnx


The package was started by the following engineers and data scientists at Microsoft starting from winter 2017: Zeeshan Ahmed, Wei-Sheng Chin, Aidan Crook, Xavier Dupré, Costin Eseanu, Tom Finley, Lixin Gong, Scott Inglis, Pei Jiang, Ivan Matantsev, Prabhat Roy, M. Zeeshan Siddiqui, Shouheng Yi, Shauheen Zahirazami, Yiwen Zhu, Du Li, Xuan Li, Wenbing Li.


It is licensed with MIT License.