-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Loading old model files is broken. #1290
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
Conversation
{ | ||
using (var env = new LocalEnvironment() | ||
.AddStandardComponents()) | ||
using (var modelStream = File.OpenRead("OriginalVersionBinaryLoader.zip")) |
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.
OriginalVersionBinaryLoader [](start = 52, length = 27)
Do we have this file in repo?
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.
It comes through the TestModels NuGet package I added.
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.
Is this sustainable? Suppose Scott wants to add a couple more models to test back-compat. How can he do this?
In reply to: 226122081 [](ancestors = 226122081)
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.
Yes, it is sustainable. I am following the same pattern we use for ONNX and TensorFlow test models.
You check the model file into a folder in https://github.com/dotnet/machinelearning-testdata. For example, if Scott has more ML.NET model files, he adds them under https://github.com/dotnet/machinelearning-testdata/tree/master/Microsoft.ML.TestModels, sends a PR and merges. Then someone builds the NuGet package from that repo, and uploads it to our NuGet feed: https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.ML.TestModels.
The NuGet packages are versioned, so as new versions are created (with new or updated model files), we can just bump the version number in this repo, and start using the new models in the test code.
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.
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.
Older model files are failing to load due to FpTail checks in the model validation code. These checks weren't happening in the old model loading code, and they now fail on some older models. Fix this by returning early when it is an older model, and there are no strings. This preserves the old behavior. Fix dotnet#1289
3fe66fb
to
d5407f7
Compare
{ | ||
using (var env = new LocalEnvironment() | ||
.AddStandardComponents()) | ||
using (var modelStream = File.OpenRead("OriginalVersionBinaryLoader.zip")) |
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.
I might recommend naming this model w/ the version number which created it. Saying 'OriginalVersion' makes me think we'll have a plethora of non-comparable names like 'NewVersion', and 'NewVersionAfterUpdate'.
using (var modelStream = File.OpenRead("OriginalVersionBinaryLoader.zip")) | |
using (var modelStream = File.OpenRead("BinaryLoader-v3.11.0.0.zip")) |
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.
Good idea. I need to update the TestModels NuGet package, which I'm doing here: dotnet/machinelearning-testdata#8.
Once that is approved, merged, and published, I will update this PR.
Closing & reopening to restart CI tests. Failure spot was on a nuget download for OSX both debug & release:
|
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.
Woo thanks @eerhardt !
Older model files are failing to load due to FpTail checks in the model validation code. These checks weren't happening in the old model loading code, and they now fail on some older models.
Fix this by returning early when it is an older model, and there are no strings. This preserves the old behavior.
Fix #1289