Functional API (keras.models.Model
) yields erroneous graph when initialized by the input
attribute of another Model
constructed from an intermediate symbolic tensor.
#20668
Labels
When a
keras.models.Model
instance is initialized from theinput
attribute from anotherModel
that was constructed by passing an intermediate symbolic tensor that was an output of another external layer as the input, the resultingModel
incorrectly includes layers that were used to construct the intermediate input tensor.I'm afraid the above sentence will amount to little more than gibberish without an example, so please refer to the following notebook:
https://colab.research.google.com/drive/1lfif-YosIn4wgzL8t8WjX520C_0eDTGV?usp=sharing
The notebook illustrates a simplified version of a text processing scenario, in which the full model is split into a preprocessing portion and a trainable portion.
The text was updated successfully, but these errors were encountered: