{"record":{"id":"5f1c6d9c399da673","repo":"keras-team/keras","slug":"sequential-model-self-name-has-already-been-co","errorCode":null,"errorMessage":"Sequential model '{self.name}' has already been configured to use input shape {self._layers[0].batch_shape}. You cannot add a different Input layer to it.","messagePattern":"Sequential model '(.+?)' has already been configured to use input shape (.+?)\\. You cannot add a different Input layer to it\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/models/sequential.py","lineNumber":114,"sourceCode":"        if not isinstance(layer, Layer):\n            raise ValueError(\n                \"Only instances of `keras.Layer` can be \"\n                f\"added to a Sequential model. Received: {layer} \"\n                f\"(of type {type(layer)})\"\n            )\n        if not self._is_layer_name_unique(layer):\n            raise ValueError(\n                \"All layers added to a Sequential model \"\n                f\"should have unique names. Name '{layer.name}' is already \"\n                \"the name of a layer in this model. Update the `name` argument \"\n                \"to pass a unique name.\"\n            )\n        if (\n            isinstance(layer, InputLayer)\n            and self._layers\n            and isinstance(self._layers[0], InputLayer)\n        ):\n            raise ValueError(\n                f\"Sequential model '{self.name}' has already been configured \"\n                f\"to use input shape {self._layers[0].batch_shape}. You cannot \"\n                f\"add a different Input layer to it.\"\n            )\n\n        self._layers.append(layer)\n        if rebuild:\n            self._maybe_rebuild()\n        else:\n            self.built = False\n            self._functional = None\n\n    def pop(self, rebuild=True):\n        \"\"\"Removes the last layer in the model.\n\n        Args:\n            rebuild: `bool`. Whether to rebuild the model after removing\n            the layer. Defaults to `True`.","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/models/sequential.py#L96-L132","documentation":"Error \"Sequential model '{self.name}' has already been configured to use input shape {self._layers[0].batch_shape}. You cannot add a different Input layer to it.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/models/sequential.py:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}