Skip to content

Functional API (keras.models.Model) yields erroneous graph when initialized by the input attribute of another Model constructed from an intermediate symbolic tensor. #20668

Closed
@briango28

Description

@briango28

When a keras.models.Model instance is initialized from the input attribute from another Model that was constructed by passing an intermediate symbolic tensor that was an output of another external layer as the input, the resulting Model 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions