Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: partially fix the bug of load_model #1164

Merged
merged 2 commits into from
Aug 26, 2023

Conversation

Wanglongzhi2001
Copy link
Collaborator

@Wanglongzhi2001 Wanglongzhi2001 commented Aug 26, 2023

Load_model use reflection to revive LayerArgs and then revive Layer.

var argType = Assembly.Load("Tensorflow.Binding").GetType($"Tensorflow.Keras.ArgsDefinition.{class_name}Args");
if(argType is null)
{
return null;
}
var deserializationMethod = typeof(JToken).GetMethods(BindingFlags.Instance | BindingFlags.Public)

So each layer's args must be the pattern of {class_name}Args, otherwise it cannot be revived.

@Wanglongzhi2001
Copy link
Collaborator Author

Wanglongzhi2001 commented Aug 26, 2023

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.

@Oceania2018 Oceania2018 merged commit fed53f1 into SciSharp:master Aug 26, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants