{"record":{"id":"f2c46a5ec8877000","repo":"keras-team/keras","slug":"invalid-value-received-for-argument-noise-shape-f2c46a","errorCode":null,"errorMessage":"Invalid value received for argument `noise_shape`. Expected all elements to be integers or None. Received element at index {i}: {dim} (type: {type(dim).__name__})","messagePattern":"Invalid value received for argument `noise_shape`\\. Expected all elements to be integers or None\\. Received element at index (.+?): (.+?) \\(type: (.+?)\\)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/regularization/dropout.py","lineNumber":83,"sourceCode":"                f\"Expected a tuple or list of integers. \"\n                f\"Received: noise_shape={noise_shape}\"\n            )\n\n        if not isinstance(noise_shape, tuple):\n            try:\n                noise_shape = tuple(noise_shape)\n            except TypeError:\n                raise ValueError(\n                    f\"Invalid value received for argument `noise_shape`. \"\n                    f\"Expected an iterable of integers \"\n                    f\"(e.g., a tuple or list). \"\n                    f\"Received: noise_shape={noise_shape}\"\n                )\n\n        for i, dim in enumerate(noise_shape):\n            if dim is not None:\n                if not isinstance(dim, int):\n                    raise ValueError(\n                        f\"Invalid value received for argument `noise_shape`. \"\n                        f\"Expected all elements to be integers or None. \"\n                        f\"Received element at index {i}: {dim} \"\n                        f\"(type: {type(dim).__name__})\"\n                    )\n\n                if dim <= 0:\n                    raise ValueError(\n                        f\"Invalid value received for argument `noise_shape`. \"\n                        f\"Expected all dimensions to be positive integers \"\n                        f\"or None. \"\n                        f\"Received negative or zero value at index {i}: {dim}\"\n                    )\n\n        return noise_shape\n\n    def call(self, inputs, training=False):\n        if training and self.rate > 0:","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/regularization/dropout.py#L65-L101","documentation":"Error \"Invalid value received for argument `noise_shape`. Expected all elements to be integers or None. Received element at index {i}: {dim} (type: {type(dim).__name__})\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/regularization/dropout.py:83 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"}