-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #234, add converter for IsolationForest #492
Conversation
This pull request introduces 2 alerts when merging 5799d65 into 2bd006e - view on LGTM.com new alerts:
|
@xadupre thank you for working on this. I tried your branch, but I cannot run the created model with onnxruntime, am I missing something? Here is a snippet adapted from your test: import numpy as np
import onnxruntime as rt
from sklearn.ensemble import IsolationForest
from skl2onnx import to_onnx
data = np.random.randn(100, 4).astype(np.float32)
model = IsolationForest(n_estimators=2, random_state=0).fit(data)
# No issue to create the model
model_onnx = to_onnx(model, data)
with open("/tmp/model.onnx", "wb") as f:
f.write(model_onnx.SerializeToString())
# NotImplemented error
sess = rt.InferenceSession("/tmp/model.onnx") Which raise
Which itself point to an issue coming from around here. Any clue? |
Which version of onnxruntime are you using? |
The latest version, 1.4 (installed with pip) |
onnxruntime does not implement parameter keys_floats of LabelEncoder. I used keys_int64s instead but it adds a cast to the graph. It should fix your issue. |
It does indeed. Thank you for the quick fix 👍 |
No description provided.