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
I'm trying to create a pipeline with 3 models. I wanted to do try out a POC with a toy dataset simulating 3 classifiers that I've actually trained. So I picked up the iris dataset and broke it into 3 datasets for each model and class.
Amongst the 3 models, the first two are LightGBM classifer and the 3rd is a RandomForest classifer.
The objective is to take 4 features and have 3 binary classifiers send their prediction in a pipeline.
This is the code snippet I'm trying to run to generate a pipeline of onnx format:
While running the last command for model_onnx it returns this error: RuntimeError: No known ways to retrieve the number of classes for class <class '__main__.SetosaPredictionModel'>.
Library versions:
lightgbm==4.0.0
onnxmltools==1.12.0
skl2onnx==1.16.0
onnxruntime==1.17.1
I've come across some blogs trying to convert the pipeline but I need to have it for a custom model class. TIA!
The text was updated successfully, but these errors were encountered:
The full stack is not given but I assume the error comes from function calculate_linear_classifier_output_shapes which tries to infer the number of output columns. You can either create your own function to calculate the output shape or modify your model so that function def _infer_linear_classifier_output_types(operator): is able to guess the number of classes.
I'm trying to create a pipeline with 3 models. I wanted to do try out a POC with a toy dataset simulating 3 classifiers that I've actually trained. So I picked up the iris dataset and broke it into 3 datasets for each model and class.
Amongst the 3 models, the first two are LightGBM classifer and the 3rd is a RandomForest classifer.
The objective is to take 4 features and have 3 binary classifiers send their prediction in a pipeline.
This is the code snippet I'm trying to run to generate a pipeline of onnx format:
While running the last command for
model_onnx
it returns this error:RuntimeError: No known ways to retrieve the number of classes for class <class '__main__.SetosaPredictionModel'>.
Library versions:
I've come across some blogs trying to convert the pipeline but I need to have it for a custom model class. TIA!
The text was updated successfully, but these errors were encountered: