-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixing ONNX test #3253
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
Fixing ONNX test #3253
Conversation
Score column being named "Score0". The ONNX model will rename the output columns by design, therefore a different class with the ColumnName of "Score0" is needed. This fixes the test pipeline to address this issue. Fixes dotnet#2981
Codecov Report
@@ Coverage Diff @@
## master #3253 +/- ##
==========================================
+ Coverage 72.69% 72.69% +<.01%
==========================================
Files 807 807
Lines 145172 145171 -1
Branches 16225 16225
==========================================
Hits 105537 105537
+ Misses 35220 35219 -1
Partials 4415 4415
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with comments.
occur if the input type was not a variable vector or vector type. This is not needed as we do support converting basic types to equivalent ONNX tensor type. Therefore removing the check in GetOutputSchema fixes this problem.
@@ -564,8 +564,6 @@ public override SchemaShape GetOutputSchema(SchemaShape inputSchema) | |||
var input = Transformer.Inputs[i]; | |||
if (!inputSchema.TryFindColumn(input, out var col)) | |||
throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", input); | |||
if (!(col.Kind == SchemaShape.Column.VectorKind.VariableVector || col.Kind == SchemaShape.Column.VectorKind.Vector)) | |||
throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", input, "vector", col.GetTypeString()); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if input col.Kind == VariableVector, how is that case handled? If not handled, should throw exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so prior to this change, we allowed VariableVector in that it would not throw -- this change now allows for vector and simple types. I would prefer to have a test that uses VariableVector, but I have yet to find something that provides a VariableVector output AND can be saved to ONNX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jignparm from our conversation, you mentioned that we should not have allowed VariableVector to begin with and should fix as part of this change. I have updated the code to reflect that, but we should have a test that confirms if this works correctly. I have created the following issue for tracking #3375
LGTM @singlis |
The test pipeline for consuming an ONNX model would fail due to the Score column being named "Score0". The ONNX model will rename the output columns by design, therefore a different class with the ColumnName of "Score0" is needed. This fixes the test pipeline to address this issue.
Fixes #2981