You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following up from issue #569 - when using the latest nightly builds 0.7.0-preview-27004-1 models trained using the previous ML.NET release (0.5) fail to load, with the following exception:
atSystem.RuntimeMethodHandle.InvokeMethod(Objecttarget,Object[]arguments,Signaturesig,Booleanconstructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Objectobj,Object[]parameters,Object[]arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Objectobj,BindingFlagsinvokeAttr,Binderbinder,Object[]parameters,CultureInfoculture)
at Microsoft.ML.Runtime.ComponentCatalog.LoadableClassInfo.CreateInstanceCore(Object[]ctorArgs)
at Microsoft.ML.Runtime.ComponentCatalog.LoadableClassInfo.CreateInstance(IHostEnvironmentenv,Objectargs,Object[]extra)
at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes](IHostEnvironmentenv,TypesignatureType,TRes&result,Stringname,Stringoptions,Object[]extra)
at Microsoft.ML.Runtime.ComponentCatalog.TryCreateInstance[TRes,TSig](IHostEnvironmentenv,TRes&result,Stringname,Stringoptions,Object[]extra)
at Microsoft.ML.Runtime.Model.ModelLoadContext.TryLoadModelCore[TRes,TSig](IHostEnvironmentenv,TRes&result,Object[]extra)
at Microsoft.ML.Runtime.Model.ModelLoadContext.TryLoadModel[TRes,TSig](IHostEnvironmentenv,TRes&result,RepositoryReaderrep,Entryent,Stringdir,Object[]extra)
at Microsoft.ML.Runtime.Model.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironmentenv,TRes&result,RepositoryReaderrep,Entryent,Stringdir,Object[]extra)
at Microsoft.ML.Runtime.Model.ModelLoadContext.LoadModelOrNull[TRes,TSig](IHostEnvironmentenv,TRes&result,RepositoryReaderrep,Stringdir,Object[]extra)
at Microsoft.ML.Runtime.Model.ModelLoadContext.LoadModelOrNull[TRes,TSig](IHostEnvironmentenv,TRes&result,Stringname,Object[]extra)
at Microsoft.ML.Runtime.Model.ModelLoadContext.LoadModel[TRes,TSig](IHostEnvironmentenv,TRes&result,Stringname,Object[]extra)
at Microsoft.ML.Runtime.Data.CompositeDataLoader.LoadSelectedTransforms(ModelLoadContextctx,IDataViewsrcView,IHostEnvironmentenv, Func`2isTransformTagAccepted)
at Microsoft.ML.Runtime.Model.ModelFileUtils.LoadTransforms(IHostEnvironmentenv,IDataViewdata,RepositoryReaderrep)
at Microsoft.ML.Runtime.Model.ModelFileUtils.LoadTransforms(IHostEnvironmentenv,IDataViewdata,StreammodelStream)
at Microsoft.ML.Runtime.Api.ComponentCreation.LoadTransforms(IHostEnvironmentenv,StreammodelStream,IDataViewdata)
at Microsoft.ML.Runtime.Api.DataViewConstructionUtils.LoadPipeWithPredictor(IHostEnvironmentenv,StreammodelStream,IDataViewview)
at Microsoft.ML.Runtime.Api.BatchPredictionEngine`2..ctor(IHostEnvironmentenv,StreammodelStream,BooleanignoreMissingColumns,SchemaDefinitioninputSchemaDefinition,SchemaDefinitionoutputSchemaDefinition)
at Microsoft.ML.Runtime.Api.ComponentCreation.CreateBatchPredictionEngine[TSrc,TDst](IHostEnvironmentenv,StreammodelStream,BooleanignoreMissingColumns,SchemaDefinitioninputSchemaDefinition,SchemaDefinitionoutputSchemaDefinition)
at Microsoft.ML.Legacy.PredictionModel.ReadAsync[TInput,TOutput](Streamstream)
at Demo.Program.<Main>d__0.MoveNext()in C:\_Projects\OSS\MLNETPreviousModelLoadingError\Demo\Program.cs:line 25
I've attached a small demo that reproduces the above. The zip also contains a model trained on ML.NET 0.5 using the following code:
namespaceEndjin.Expenses.Demo{
#region Using Directives
usingSystem.Collections.Generic;usingEndjin.FreeAgent.Expenses.MachineLearning.Domain;usingMicrosoft.ML.Legacy;usingMicrosoft.ML.Legacy.Data;usingMicrosoft.ML.Legacy.Trainers;usingMicrosoft.ML.Legacy.Transforms;
#endregion
publicclassExpenseModelTrainer{publicPredictionModel<TransactionModel,Prediction>Train(IEnumerable<TransactionModel>input){varpipeline=newLearningPipeline{CollectionDataSource.Create(input),newTextFeaturizer("Features",nameof(TransactionModel.Description),nameof(TransactionModel.Reference),nameof(TransactionModel.Amount)),newDictionarizer(nameof(TransactionModel.Label)),newStochasticDualCoordinateAscentClassifier(),newPredictedLabelColumnOriginalValueConverter{PredictedLabelColumn=nameof(Prediction.PredictedLabel)}};returnpipeline.Train<TransactionModel,Prediction>();}}}
(The "legacy" namespaces changed in the latest version, but if you change them back to the 0.5 version namespaces - nothing else changed)
Hi
Following up from issue #569 - when using the latest nightly builds
0.7.0-preview-27004-1
models trained using the previous ML.NET release (0.5) fail to load, with the following exception:I've attached a small demo that reproduces the above. The zip also contains a model trained on ML.NET 0.5 using the following code:
(The "legacy" namespaces changed in the latest version, but if you change them back to the 0.5 version namespaces - nothing else changed)
MLNETPreviousModelLoadingError.zip
Many thanks,
Howard
The text was updated successfully, but these errors were encountered: