You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug fixes in plot_model with nested models. (#21243)
There were several issues with `keras.utils.plot_model()` / `keras.utils.model_to_dot()` when rendering nested models with `expand_nested=True`:
- Sequential models were not expanded
- Edges going into nested models would always connect to the first box in the subgraph, which is incorrect because:
- Functional models can have multiple inputs and the edge needs to point to the correct input
- The destination of the edge can be further nested sub-models like Sequential sub-models
- Edges going out of nested models would always connect from the last box in the subgraph, which is incorrect because:
- Functional models can have multiple outputs and the edge needs to come from the correct layer
- The source of the edge can be further nested in sub-models since there is no "output" box
This adds to the integration tests. In particular, it augments the way the topology is verified:
- it provides detailed message for dangling edges
- it can inspected nested subgraphs
- it verifies there are no extra edges that the ones expected
- it can verify splits in the graph
Visual tests: https://colab.research.google.com/gist/hertschuh/fb7dfdbf4fb31139e33e750ab10aaad4/plot_model-testing.ipynbFixes#21119
0 commit comments