{"record":{"id":"7cd62054251f2971","repo":"keras-team/keras","slug":"output-sequence-length-must-not-be-set-if-outpu","errorCode":null,"errorMessage":"`output_sequence_length` must not be set if `output_mode` is not 'int'. Received output_sequence_length={output_sequence_length}.","messagePattern":"`output_sequence_length` must not be set if `output_mode` is not 'int'\\. Received output_sequence_length=(.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/layers/preprocessing/text_vectorization.py","lineNumber":312,"sourceCode":"            raise ValueError(\n                \"`ngrams` must be None, an integer, or a tuple of \"\n                f\"integers. Received: ngrams={ngrams}\"\n            )\n\n        # 'output_sequence_length' must be one of (None, int) and is only\n        # set if output_mode is \"int\"\".\n        if output_mode == \"int\" and not (\n            isinstance(output_sequence_length, int)\n            or (output_sequence_length is None)\n        ):\n            raise ValueError(\n                \"`output_sequence_length` must be either None or an \"\n                \"integer when `output_mode` is 'int'. Received: \"\n                f\"output_sequence_length={output_sequence_length}\"\n            )\n\n        if output_mode != \"int\" and output_sequence_length is not None:\n            raise ValueError(\n                \"`output_sequence_length` must not be set if `output_mode` is \"\n                \"not 'int'. \"\n                f\"Received output_sequence_length={output_sequence_length}.\"\n            )\n\n        if ragged and output_mode != \"int\":\n            raise ValueError(\n                \"`ragged` must not be true if `output_mode` is \"\n                f\"`'int'`. Received: ragged={ragged} and \"\n                f\"output_mode={output_mode}\"\n            )\n\n        self._max_tokens = max_tokens\n        self._standardize = standardize\n        self._split = split\n        self._ngrams_arg = ngrams\n        if isinstance(ngrams, int):\n            self._ngrams = tuple(range(1, ngrams + 1))","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/layers/preprocessing/text_vectorization.py#L294-L330","documentation":"Error \"`output_sequence_length` must not be set if `output_mode` is not 'int'. Received output_sequence_length={output_sequence_length}.\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/layers/preprocessing/text_vectorization.py:312 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"}