harujoh / KelpNet

Pure C# machine learning framework
Apache License 2.0
242 stars 28 forks source link

ModelIO<Real>.Save(nn, "test.nn"); is wrong. #39

Closed raylihaut closed 4 years ago

raylihaut commented 4 years ago

When I carry out Sample01.cs, there are a wrong about save the model nn. The sentence is ModelIO.Save(nn, "test.nn"); and the error is System.Runtime.Serialization.InvalidDataContractException:“Virtual Method 'Void InitFunc(System.Runtime.Serialization.StreamingContext)' of type 'KelpNet.CPU.Linear`1[[System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' cannot be marked with 'System.Runtime.Serialization.OnDeserializingAttribute' attribute.” (at file ModelIO.cs, line 63, bf.WriteObject(stream, function); please help me, thanks.

harujoh commented 4 years ago

Thanks for the bug report.

I've fixed the problem, so please check back.