Skip to content

Ensure ONNX export is compatible with Windows RS5 #550

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

Merged
merged 9 commits into from
Jul 23, 2018

Conversation

codemzs
Copy link
Member

@codemzs codemzs commented Jul 18, 2018

fixes #549 by testing ONNX models on Windows RS5 machine.

@codemzs codemzs requested review from TomFinley, shauheen and wschin July 18, 2018 01:07
Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this @codemzs ... interesting how they've changed it. 😄 Do we have a handle on this OS X release build?

@@ -719,7 +719,7 @@ protected override bool SaveAsOnnxCore(OnnxContext ctx, int iinfo, ColInfo info,
var node = ctx.CreateNode(opType, srcVariableName, dstVariableName, ctx.GetNodeName(opType));
node.AddAttribute("classes_strings", terms.DenseValues());
node.AddAttribute("default_int64", -1);
node.AddAttribute("default_string", DvText.Empty);
node.AddAttribute("default_string", " "); //Temporary fix, since DvText.Empty is not supported by Lotus because it is empty string.
Copy link
Contributor

@shauheen shauheen Jul 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve the comment here for general audience. #Resolved

@codemzs
Copy link
Member Author

codemzs commented Jul 18, 2018

@TomFinley OS X release was failing for LR models because I had UseThreads set to true. Thanks for reviewing.

Copy link
Member

@wschin wschin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Just please make sure we don't use ZipMap in ML.NET because its output type got changed in ONNX-1.2.

@@ -719,7 +719,10 @@ protected override bool SaveAsOnnxCore(OnnxContext ctx, int iinfo, ColInfo info,
var node = ctx.CreateNode(opType, srcVariableName, dstVariableName, ctx.GetNodeName(opType));
node.AddAttribute("classes_strings", terms.DenseValues());
node.AddAttribute("default_int64", -1);
node.AddAttribute("default_string", DvText.Empty);
//default_string needs to be an empty string but there is a BUG in Lotus that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is Lotus? Do you mean runtime?

node.AddAttribute("multi_class", true);
node.AddAttribute("coefficients", _weights.SelectMany(w => w.DenseValues()));
node.AddAttribute("intercepts", _biases);
node.AddAttribute("classlabels_strings", _labelNames);
node.AddAttribute("classlabels_ints", Enumerable.Range(0, _numClasses).Select(x => (long)x));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LR doesn't output labels (e.g., "A" and "B") anymore?

@codemzs codemzs merged commit 8c11759 into dotnet:master Jul 23, 2018
eerhardt pushed a commit to eerhardt/machinelearning that referenced this pull request Jul 27, 2018
* remove domain from onnx operators for non-ML types.

* Make ONNX compatible with Windows RS5 and add more tests.

* PR feedback.

* PR feedback.

* fix build.
codemzs added a commit to codemzs/machinelearning that referenced this pull request Aug 1, 2018
* remove domain from onnx operators for non-ML types.

* Make ONNX compatible with Windows RS5 and add more tests.

* PR feedback.

* PR feedback.

* fix build.
@codemzs codemzs deleted the onnx branch August 3, 2018 06:03
@ghost ghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure ONNX export is Windows RS5 compatible.
4 participants