Skip to content
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

Model.ConvertToOnnx() fails for Classification pipelines if non-default Features column name is used #3089

Closed
glebuk opened this issue Mar 25, 2019 · 0 comments · Fixed by #5146
Assignees
Labels
bug Something isn't working classification Bugs related classification tasks onnx Exporting ONNX models or loading ONNX models P1 Priority of the issue for triage purpose: Needs to be fixed soon.

Comments

@glebuk
Copy link
Contributor

glebuk commented Mar 25, 2019

The following code fails to convert to ONNX model:

            var mlContext = new MLContext();
            var data = mlContext.Data.LoadFromEnumerable<Observation>(Data);
            var chain = mlContext.Transforms.Concatenate("FeatureVector", "Price")
                .Append(mlContext.BinaryClassification.Trainers.LogisticRegression(
                    "Label", "FeatureVector"));

            var transformer = chain.Fit(data);
            using (var stream = File.Create("foo.onnx"))
                mlContext.Model.ConvertToOnnx(transformer, data, stream);

On the other hand, if you rename "FeatureVector" to "Features" it works.
This happens for various learners and both binary and multiclass. for both calibrated and non-calibrated. This does NOT happen on regression

@glebuk glebuk added the bug Something isn't working label Mar 25, 2019
@Lynx1820 Lynx1820 added the P1 Priority of the issue for triage purpose: Needs to be fixed soon. label Jan 10, 2020
@harishsk harishsk added onnx Exporting ONNX models or loading ONNX models classification Bugs related classification tasks labels Apr 29, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working classification Bugs related classification tasks onnx Exporting ONNX models or loading ONNX models P1 Priority of the issue for triage purpose: Needs to be fixed soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants