Skip to content

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

Merged
merged 2 commits into from
Oct 18, 2018
Merged

Conversation

eerhardt
Copy link
Member

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

{
using (var env = new LocalEnvironment()
.AddStandardComponents())
using (var modelStream = File.OpenRead("OriginalVersionBinaryLoader.zip"))
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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)

Copy link
Member Author

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.

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@Zruty0 Zruty0 left a comment

Choose a reason for hiding this comment

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

:shipit:

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
{
using (var env = new LocalEnvironment()
.AddStandardComponents())
using (var modelStream = File.OpenRead("OriginalVersionBinaryLoader.zip"))
Copy link
Contributor

@justinormont justinormont Oct 18, 2018

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'.

Suggested change
using (var modelStream = File.OpenRead("OriginalVersionBinaryLoader.zip"))
using (var modelStream = File.OpenRead("BinaryLoader-v3.11.0.0.zip"))

Copy link
Member Author

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.

@justinormont
Copy link
Contributor

Closing & reopening to restart CI tests.

Failure spot was on a nuget download for OSX both debug & release:

2018-10-18T16:37:41.1798700Z   Failed to download package 'Microsoft.ML.Scoring.1.1.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.ml.scoring/1.1.0/microsoft.ml.scoring.1.1.0.nupkg'.
2018-10-18T16:37:41.1799680Z   The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.ml.scoring/1.1.0/microsoft.ml.scoring.1.1.0.nupkg' timed out because no data was received for 60000ms.
2018-10-18T16:37:41.1800340Z     Exception of type 'System.TimeoutException' was thrown.

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.

Woo thanks @eerhardt !

@eerhardt eerhardt merged commit 14dadfe into dotnet:master Oct 18, 2018
@eerhardt eerhardt deleted the FixModelLoadBug branch October 18, 2018 20:41
@ghost ghost locked as resolved and limited conversation to collaborators Mar 27, 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.

5 participants