Skip to content

Instantly share code, notes, and snippets.

@naxty
Last active August 6, 2019 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naxty/c9cc234e421b7b51f063b461f8c65ef0 to your computer and use it in GitHub Desktop.
Save naxty/c9cc234e421b7b51f063b461f8c65ef0 to your computer and use it in GitHub Desktop.
Running a prediction with onnx runtime.
import onnxruntime as rt
import numpy
sess = rt.InferenceSession("boston_housting.onnx")
input_name = sess.get_inputs()[0].name
label_name = sess.get_outputs()[0].name
prediction = sess.run([label_name], {input_name: X_test.astype(numpy.float32)})[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment