You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting the pipeline to onnx, I met the error:
Unable to find a shape calculator for type '<class 'xgboost.sklearn.XGBClassifier'>'.
It usually means the pipeline being converted contains a
transformer or a predictor with no corresponding converter
implemented in sklearn-onnx. If the converted is implemented
in another library, you need to register
the converted so that it can be used by sklearn-onnx (function
update_registered_converter). If the model is not yet covered
by sklearn-onnx, you may raise an issue to https://github.com/onnx/sklearn-onnx/issues
to get the converter implemented or even contribute to the
project. If the model is a custom model, a new converter must
be implemented. Examples can be found in the gallery.
The pipeline code contain a preprocessor and a XGB decision tree model, I created is as followed:
The error occurs when converting the pipeline. I researched that all the steps in preprocessor are acceptable. I wonder whether it's onnx that cannot deal with complex transformers.
The text was updated successfully, but these errors were encountered:
Annanapan
changed the title
Unable to find a shape calculator for type '<class 'xgboost.sklearn.XGBClassifier'>'.
MissingShapeCalculator: Unable to find a shape calculator for type '<class 'xgboost.sklearn.XGBClassifier'>'.
Feb 28, 2024
Is this the right way to prepare the input for prediction using onnx?
prepare X_test_inputs for onnx model
X_test_inputs = {c: X_test[c].values for c in X_test.columns}
for c in num_features:
v = X_test[c].dtype
if v == "float64":
X_test_inputs[c] = X_test_inputs[c].astype(np.float32)
for k in X_test_inputs:
X_test_inputs[k] = X_test_inputs[k].reshape((X_test_inputs[k].shape[0], 1))
When converting the pipeline to onnx, I met the error:
The pipeline code contain a preprocessor and a XGB decision tree model, I created is as followed:
The error occurs when converting the pipeline. I researched that all the steps in preprocessor are acceptable. I wonder whether it's onnx that cannot deal with complex transformers.
versions:
skl2onnx: 1.16.0
sklearn: 1.4.0
Python: 3.11.7
The text was updated successfully, but these errors were encountered: