Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Thanks @Sagar . One more question please, according to Keras Layers are recursively composable, which means that if we want to assign a layer instance in another layer, then it is recommended creating such sublayers in the __init__() method and leave it to the first __call__() to trigger building their weights. So I followed this recommendation but its not working in my case, so I was wondering why it is not working here ? Commented Jan 13 at 11:36
  • @Ahmed That recommendation assume call() will run but load_model skip the call() method entirely, so your sub-layers never get the signal to create variables. You must build them manually because Keras don't execute your forward pass logic during loading. Commented Jan 14 at 5:37