SciSharp / TensorFlow.NET

.NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.
https://scisharp.github.io/tensorflow-net-docs
Apache License 2.0
3.23k stars 517 forks source link

fix: partially fix the bug of load_model #1164

Closed Wanglongzhi2001 closed 1 year ago

Wanglongzhi2001 commented 1 year ago

Load_model use reflection to revive LayerArgs and then revive Layer. https://github.com/SciSharp/TensorFlow.NET/blob/adeed05f64cf033a7d945d97ba4b59bc5ec4aa03/src/TensorFlowNET.Keras/Utils/generic_utils.cs#L64-L69 So each layer's args must be the pattern of {class_name}Args, otherwise it cannot be revived.

Wanglongzhi2001 commented 1 year ago

But there still exists some bug when use Merge Layer such as Add layer or Substract layer. When use Merge Layer, there will be some error when buildMap. So user arr better to not use Merge Layer at present.