Skip to content

[DNN Training] Failed save model in Microsoft.ML.Transforms.DnnTransformer.SaveModel #4191

Closed
@yamachu

Description

@yamachu

System information

  • OS version/distro: maxOS 10.14.6
  • .NET Version (eg., dotnet --info): 3.0.100-preview9-014004

Issue

  • What did you do?

    • Use RetrainDnnModel for training regression-based deep-neural-network model
    • Try to save trained model
  • What happened?

Application throw unhandled exception: System.ArgumentNullException and crash

  • What did you expect?

We could save trained model

Source code / logs

Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'value')
   at System.IO.BinaryWriter.Write(String value)
   at Microsoft.ML.Transforms.DnnTransformer.SaveModel(ModelSaveContext ctx)
   at Microsoft.ML.Data.RowToRowTransformerBase.Microsoft.ML.ICanSaveModel.Save(ModelSaveContext ctx)
   at Microsoft.ML.ModelSaveContext.SaveModel[T](RepositoryWriter rep, T value, String path)
   at Microsoft.ML.ModelOperationsCatalog.Save(ITransformer model, DataViewSchema inputSchema, Stream stream)
   at Microsoft.ML.ModelOperationsCatalog.Save(ITransformer model, DataViewSchema inputSchema, String filePath)
   at VoiceConversionStarter.Console.Program.Train(TrainMcapOptions opts) in /Users/yamachu/Projects/github.com/yamachu/VoiceConversionStarter/VoiceConversionStarter.Console/Program.cs:line 100
   at VoiceConversionStarter.Console.Program.<>c.<Main>b__2_0(TrainMcapOptions opts) in /Users/yamachu/Projects/github.com/yamachu/VoiceConversionStarter/VoiceConversionStarter.Console/Program.cs:line 118
   at CommandLine.ParserResultExtensions.MapResult[TSource,TResult](ParserResult`1 result, Func`2 parsedFunc, Func`2 notParsedFunc)
   at VoiceConversionStarter.Console.Program.Main(String[] args) in /Users/yamachu/Projects/github.com/yamachu/VoiceConversionStarter/VoiceConversionStarter.Console/Program.cs:line 116

I think this issue is not to check null in this line

ctx.Writer.Write(_predictionTensorName);
ctx.Writer.Write(_softmaxTensorName);

That field in my trained model is null
スクリーンショット 2019-09-09 1 21 42

full source code: https://github.com/yamachu/VoiceConversionStarter/tree/pkg-update

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions