Keras plot_model not showing the input layer appropriately

后端 未结 1 509
孤城傲影
孤城傲影 2020-12-11 04:17

My model is defined as such:

model = keras.models.Sequential()
model.add(layers.Embedding(max_features, 128, input_length=max_len,
                       in         


        
1条回答
  •  猫巷女王i
    2020-12-11 04:51

    It happened to me after upgrading Keras

    check this link: https://github.com/keras-team/keras/issues/10638

    In keras/engine/sequential.py

    Comment this out:

    @property
    def layers(self):
        # Historically, `sequential.layers` only returns layers that were added
        # via `add`, and omits the auto-generated `InputLayer`
        # that comes at the bottom of the stack.
        if self._layers and isinstance(self._layers[0], InputLayer):
            return self._layers[1:]
        return self._layers
    

    0 讨论(0)
提交回复
热议问题