keras-team/keras · error · ValueError
`ragged` must not be true if `output_mode` is `'int'`. Recei
Error message
`ragged` must not be true if `output_mode` is `'int'`. Received: ragged={ragged} and output_mode={output_mode} What it means
Error "`ragged` must not be true if `output_mode` is `'int'`. Received: ragged={ragged} and output_mode={output_mode}" thrown in keras-team/keras.
Source
Thrown at keras/src/layers/preprocessing/text_vectorization.py:319
if output_mode == "int" and not (
isinstance(output_sequence_length, int)
or (output_sequence_length is None)
):
raise ValueError(
"`output_sequence_length` must be either None or an "
"integer when `output_mode` is 'int'. Received: "
f"output_sequence_length={output_sequence_length}"
)
if output_mode != "int" and output_sequence_length is not None:
raise ValueError(
"`output_sequence_length` must not be set if `output_mode` is "
"not 'int'. "
f"Received output_sequence_length={output_sequence_length}."
)
if ragged and output_mode != "int":
raise ValueError(
"`ragged` must not be true if `output_mode` is "
f"`'int'`. Received: ragged={ragged} and "
f"output_mode={output_mode}"
)
self._max_tokens = max_tokens
self._standardize = standardize
self._split = split
self._ngrams_arg = ngrams
if isinstance(ngrams, int):
self._ngrams = tuple(range(1, ngrams + 1))
else:
self._ngrams = ngrams
self._ragged = ragged
self._output_mode = output_mode
self._output_sequence_length = output_sequence_length
self._encoding = encodingView on GitHub (pinned to 7a34a03db6)
When it happens
Trigger: Thrown at keras/src/layers/preprocessing/text_vectorization.py:319 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25).
Data as JSON: /api/errors/1b93b114024a8250.
Report an issue: GitHub.