-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading old model files is broken. (#1290)
* Loading old model files is broken. 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
- Loading branch information
Showing
4 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,44 @@ | ||
<Project> | ||
|
||
<!-- Core Product Dependencies --> | ||
<PropertyGroup> | ||
<GoogleProtobufPackageVersion>3.5.1</GoogleProtobufPackageVersion> | ||
<NewtonsoftJsonPackageVersion>10.0.3</NewtonsoftJsonPackageVersion> | ||
<ParquetDotNetPackageVersion>2.1.3</ParquetDotNetPackageVersion> | ||
<SystemThreadingTasksDataflowPackageVersion>4.8.0</SystemThreadingTasksDataflowPackageVersion> | ||
<SystemCodeDomPackageVersion>4.4.0</SystemCodeDomPackageVersion> | ||
<SystemCollectionsImmutableVersion>1.5.0</SystemCollectionsImmutableVersion> | ||
<SystemMemoryVersion>4.5.1</SystemMemoryVersion> | ||
<SystemReflectionEmitLightweightPackageVersion>4.3.0</SystemReflectionEmitLightweightPackageVersion> | ||
<PublishSymbolsPackageVersion>1.0.0-beta-62824-02</PublishSymbolsPackageVersion> | ||
<SystemThreadingTasksDataflowPackageVersion>4.8.0</SystemThreadingTasksDataflowPackageVersion> | ||
</PropertyGroup> | ||
|
||
<!-- Other/Non-Core Product Dependencies --> | ||
<PropertyGroup> | ||
<GoogleProtobufPackageVersion>3.5.1</GoogleProtobufPackageVersion> | ||
<LightGBMPackageVersion>2.2.1.1</LightGBMPackageVersion> | ||
<MicrosoftMLScoring>1.1.0</MicrosoftMLScoring> | ||
<MlNetMklDepsPackageVersion>0.0.0.7</MlNetMklDepsPackageVersion> | ||
<ParquetDotNetPackageVersion>2.1.3</ParquetDotNetPackageVersion> | ||
<SystemDrawingCommonPackageVersion>4.5.0</SystemDrawingCommonPackageVersion> | ||
<BenchmarkDotNetVersion>0.11.1</BenchmarkDotNetVersion> | ||
<SystemIOFileSystemAccessControl>4.5.0</SystemIOFileSystemAccessControl> | ||
<SystemSecurityPrincipalWindows>4.5.0</SystemSecurityPrincipalWindows> | ||
<TensorFlowVersion>1.10.0</TensorFlowVersion> | ||
<SystemCollectionsImmutableVersion>1.5.0</SystemCollectionsImmutableVersion> | ||
<SystemMemoryVersion>4.5.1</SystemMemoryVersion> | ||
</PropertyGroup> | ||
|
||
<!-- Code Analyzer Dependencies --> | ||
<PropertyGroup> | ||
<MicrosoftCodeAnalysisCSharpVersion>2.9.0</MicrosoftCodeAnalysisCSharpVersion> | ||
<MicrosoftCSharpVersion>4.5.0</MicrosoftCSharpVersion> | ||
<SystemCompositionVersion>1.2.0</SystemCompositionVersion> | ||
<MicrosoftMLScoring>1.1.0</MicrosoftMLScoring> | ||
<SystemIOFileSystemAccessControl>4.5.0</SystemIOFileSystemAccessControl> | ||
<SystemSecurityPrincipalWindows>4.5.0</SystemSecurityPrincipalWindows> | ||
</PropertyGroup> | ||
|
||
<!-- Build/infrastructure Dependencies --> | ||
<PropertyGroup> | ||
<PublishSymbolsPackageVersion>1.0.0-beta-62824-02</PublishSymbolsPackageVersion> | ||
</PropertyGroup> | ||
|
||
<!-- Test-only Dependencies --> | ||
<PropertyGroup> | ||
<BenchmarkDotNetVersion>0.11.1</BenchmarkDotNetVersion> | ||
<MicrosoftMLTestModelsPackageVersion>0.0.2-test</MicrosoftMLTestModelsPackageVersion> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.ML.Runtime.Data; | ||
using Microsoft.ML.Runtime.Model; | ||
using Microsoft.ML.TestFramework; | ||
using System.IO; | ||
using Xunit; | ||
|
||
namespace Microsoft.ML.Runtime.RunTests | ||
{ | ||
public class TestModelLoad | ||
{ | ||
/// <summary> | ||
/// Tests loading a model file that was saved using an older version still loads correctly. | ||
/// </summary> | ||
[Fact] | ||
public void LoadOriginalBinaryLoaderModel() | ||
{ | ||
using (var env = new LocalEnvironment() | ||
.AddStandardComponents()) | ||
using (var modelStream = File.OpenRead(Path.Combine("TestModels", "BinaryLoader-v3.11.0.0.zip"))) | ||
using (var rep = RepositoryReader.Open(modelStream, env)) | ||
{ | ||
IDataLoader result = ModelFileUtils.LoadLoader(env, rep, new MultiFileSource(null), true); | ||
|
||
Assert.Equal(2, result.Schema.ColumnCount); | ||
Assert.Equal("Image", result.Schema[0].Name); | ||
Assert.Equal("Class", result.Schema[1].Name); | ||
} | ||
} | ||
} | ||
} |