{"record":{"id":"964a21b5c7b6d5ea","repo":"keras-team/keras","slug":"cropping-parameter-of-cropping1d-layer-must-be","errorCode":null,"errorMessage":"`cropping` parameter of `Cropping1D` layer must be smaller than the input length. Received: input_shape={input_shape}, cropping={self.cropping}","messagePattern":"`cropping` parameter of `Cropping1D` layer must be smaller than the input length\\. Received: input_shape=(.+?), cropping=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/reshaping/cropping1d.py","lineNumber":55,"sourceCode":"    Input shape:\n        3D tensor with shape `(batch_size, axis_to_crop, features)`\n\n    Output shape:\n        3D tensor with shape `(batch_size, cropped_axis, features)`\n    \"\"\"\n\n    def __init__(self, cropping=(1, 1), **kwargs):\n        super().__init__(**kwargs)\n        self.cropping = argument_validation.standardize_tuple(\n            cropping, 2, \"cropping\", allow_zero=True\n        )\n        self.input_spec = InputSpec(ndim=3)\n\n    def compute_output_shape(self, input_shape):\n        if input_shape[1] is not None:\n            length = input_shape[1] - self.cropping[0] - self.cropping[1]\n            if length <= 0:\n                raise ValueError(\n                    \"`cropping` parameter of `Cropping1D` layer must be \"\n                    \"smaller than the input length. Received: input_shape=\"\n                    f\"{input_shape}, cropping={self.cropping}\"\n                )\n        else:\n            length = None\n        return (input_shape[0], length, input_shape[2])\n\n    def call(self, inputs):\n        if (\n            inputs.shape[1] is not None\n            and sum(self.cropping) >= inputs.shape[1]\n        ):\n            raise ValueError(\n                \"`cropping` parameter of `Cropping1D` layer must be \"\n                \"smaller than the input length. Received: inputs.shape=\"\n                f\"{inputs.shape}, cropping={self.cropping}\"\n            )","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/reshaping/cropping1d.py#L37-L73","documentation":"Error \"`cropping` parameter of `Cropping1D` layer must be smaller than the input length. Received: input_shape={input_shape}, cropping={self.cropping}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/reshaping/cropping1d.py:55 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"}