Skip to main content

ONNX Runtime enables high-performance evaluation of trained machine learning (ML) models while keeping resource usage low. Building on Microsoft’s dedication to the Open Neural Network Exchange (ONNX) community, it supports traditional ML models as well as Deep Learning algorithms in the ONNX-ML format. Documentation is available at Python Bindings for ONNX Runtime.

Example

The following example demonstrates an end-to-end example in a very common scenario. A model is trained with scikit-learn but it has to run very fast in a optimized environment. The model is then converted into ONNX format and ONNX Runtime replaces scikit-learn to compute the predictions.

# Train a model.
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
iris = load_iris()
X, y = iris.data, iris.target
X_train, X_test, y_train, y_test = train_test_split(X, y)
clr = RandomForestClassifier()
clr.fit(X_train, y_train)

# Convert into ONNX format with onnxmltools
from skl2onnx import convert_sklearn
from skl2onnx.common.data_types import FloatTensorType
initial_type = [('float_input', FloatTensorType([1, 4]))]
onx = convert_sklearn(clr, initial_types=initial_type)
with open("rf_iris.onnx", "wb") as f:
    f.write(onx.SerializeToString())

# Compute the prediction with ONNX Runtime
import onnxruntime as rt
import numpy
sess = rt.InferenceSession("rf_iris.onnx")
input_name = sess.get_inputs()[0].name
label_name = sess.get_outputs()[0].name
pred_onx = sess.run([label_name], {input_name: X_test.astype(numpy.float32)})[0]

Changes

0.3.0

C-API, Linux support for Dotnet Nuget package, Cuda 9.1 support.

0.2.1

C-API, Linux support for Dotnet Nuget package, Cuda 10.0 support (patch to 0.2.0).

0.2.0

C-API, Linux support for Dotnet Nuget package, Cuda 10.0 support

0.1.5

GA release as part of open sourcing onnxruntime (patch to 0.1.4).

0.1.4

GA release as part of open sourcing onnxruntime.

0.1.3

Fixes a crash on machines which do not support AVX instructions.

0.1.2

First release on Ubuntu 16.04 for CPU and GPU with Cuda 9.1 and Cudnn 7.0, supports runtime for deep learning models architecture such as AlexNet, ResNet, XCeption, VGG, Inception, DenseNet, standard linear learner, standard ensemble learners, and transform scaler, imputer.

Release files for onnxruntime 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for onnxruntime 0.3.0
File
onnxruntime-0.3.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
onnxruntime-0.3.0-cp37-cp37m-manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details
onnxruntime-0.3.0-cp37-cp37m-macosx_10_7_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.7+ x86-64 Details
onnxruntime-0.3.0-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
onnxruntime-0.3.0-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
onnxruntime-0.3.0-cp36-cp36m-macosx_10_7_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.7+ x86-64 Details
onnxruntime-0.3.0-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
onnxruntime-0.3.0-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details
onnxruntime-0.3.0-cp35-cp35m-macosx_10_6_x86_64.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.6+ x86-64 Details

Total release size: 26.1 MB

Release files / onnxruntime-0.3.0-cp37-cp37m-win_amd64.whl

Download URL onnxruntime-0.3.0-cp37-cp37m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0e7d9f13a5bf028094431c31e02624b9f21f91bce02382d77ffaac0a69dd992f
BLAKE2b-256 checksum
How to use checksums
b93fdbb5cebea90480407491918cbd00ffa45a1532ce192cca9e849f2acf8378
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp37-cp37m-manylinux1_x86_64.whl

Download URL onnxruntime-0.3.0-cp37-cp37m-manylinux1_x86_64.whl
Size 3.6 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
9e55cc18ef0f2d75867e9315f4801d43f043befe6621ac4efbe342cb9a9898bd
BLAKE2b-256 checksum
How to use checksums
ec9a90d8f93ec5865a3b756d23ed5e43d0affe2483711cca816067a4592dff29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp37-cp37m-macosx_10_7_x86_64.whl

Download URL onnxruntime-0.3.0-cp37-cp37m-macosx_10_7_x86_64.whl
Size 3.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
8826bc4abb024feff15c4ed667f33e5d8141337156a3b29477739bd78127cf0f
BLAKE2b-256 checksum
How to use checksums
5e77814612caac4c7c69c3458fb3bf70f4c31ec9420876c66a174b3f27183805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp36-cp36m-win_amd64.whl

Download URL onnxruntime-0.3.0-cp36-cp36m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0d360de4ecd5d8045fd33b26d45567e99ba39b201f8be8107e902d761ed3f2e7
BLAKE2b-256 checksum
How to use checksums
bb742c8a7d4ef6549525599c661a1cc0d95ec5523e35812258ad981446aa0815
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp36-cp36m-manylinux1_x86_64.whl

Download URL onnxruntime-0.3.0-cp36-cp36m-manylinux1_x86_64.whl
Size 3.6 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
117e1e5b40593407bebab619dded59d69c8bad407cec04bbce34dc5e91f3ab50
BLAKE2b-256 checksum
How to use checksums
0da7dcec3fce9709492e3b5ea8b0dbda5a343bafab2adced2b001a14ce3bdd8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp36-cp36m-macosx_10_7_x86_64.whl

Download URL onnxruntime-0.3.0-cp36-cp36m-macosx_10_7_x86_64.whl
Size 3.0 MB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
e14c783ac59870be1e46dfa9b890fc4890c5dd7079da48928a24b0b9f5c7903a
BLAKE2b-256 checksum
How to use checksums
5be5fc53bd8861219f4b46a1b43d3b1fac2e8694610e425eb81e053c5598ff14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp35-cp35m-win_amd64.whl

Download URL onnxruntime-0.3.0-cp35-cp35m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
e0bbb1f4500e31966c6f11486db81851332b1419202631637c2a8709355bf1fd
BLAKE2b-256 checksum
How to use checksums
fbfc3e946df70a8b00eca339d7f6387ac07deb2da90e84ce502573b5744811c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp35-cp35m-manylinux1_x86_64.whl

Download URL onnxruntime-0.3.0-cp35-cp35m-manylinux1_x86_64.whl
Size 3.6 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
27f6e9e2d36f8ba3be4f65ee3b34720d0dd5394a7c66c87aa871028fc2863d5b
BLAKE2b-256 checksum
How to use checksums
1a04439221d2aab4ff54923a97891240bce4856495a4de2459099b5a7a1de7b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / onnxruntime-0.3.0-cp35-cp35m-macosx_10_6_x86_64.whl

Download URL onnxruntime-0.3.0-cp35-cp35m-macosx_10_6_x86_64.whl
Size 3.0 MB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.6+ x86-64
SHA-256 checksum
How to use checksums
05386d8f88b6485067f40fcbf7343fe869e49af63edce573ebfbe64b4d3fd5a4
BLAKE2b-256 checksum
How to use checksums
d43190d91aec62b6df3352bfa1b978e3d61a76b50f09109a4e7adaebf7c41d56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

1.9.0

20 release files

1.6.0

15 release files

1.5.2

15 release files

1.5.1

15 release files

1.4.0

15 release files

1.3.0

15 release files

1.2.0

12 release files

1.1.2

9 release files

1.1.1

9 release files

1.1.0

9 release files

1.0.0

9 release files

0.5.0

9 release files

0.4.0

9 release files

This release

0.3.0 This release

9 release files

0.2.1

9 release files

0.1.4

8 release files

0.1.3

3 release files

0.1.2

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page