Skip to content

Instantly share code, notes, and snippets.

@naxty
Last active October 7, 2019 15:34
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/820fb835b5d7c94693bcae901a308ee6 to your computer and use it in GitHub Desktop.
Save naxty/820fb835b5d7c94693bcae901a308ee6 to your computer and use it in GitHub Desktop.
Converts sklearn model to onnx model.
from skl2onnx import convert_sklearn
from skl2onnx.common.data_types import FloatTensorType
initial_type = [('float_input', FloatTensorType([1, 10]))]
onx = convert_sklearn(model, initial_types=initial_type)
with open("boston_housing.onnx", "wb") as f:
f.write(onx.SerializeToString())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment