且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Keras plot_model 未正确显示输入层

更新时间:2023-12-03 11:13:52

我升级 Keras 后发生的事情

It happened to me after upgrading Keras

检查此链接:https://github.com/keras-team/keras/问题/10638

在 keras/engine/sequential.py

In keras/engine/sequential.py

注释掉:

@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