tensorflow/models · error · ValueError

length of vocab_sizes: {len(vocab_sizes)} is not equal to th

Error message

length of vocab_sizes: {len(vocab_sizes)} is not equal to the length of max_unique_ids_per_table: {len(max_unique_ids_per_table)}

What it means

Error "length of vocab_sizes: {len(vocab_sizes)} is not equal to the length of max_unique_ids_per_table: {len(max_unique_ids_per_table)}" thrown in tensorflow/models.

Source

Thrown at official/recommendation/ranking/task.py:100

    )

  if isinstance(max_ids_per_table, List):
    if len(vocab_sizes) != len(max_ids_per_table):
      raise ValueError(
          f'length of vocab_sizes: {len(vocab_sizes)} is not equal to the '
          f'length of max_ids_per_table: {len(max_ids_per_table)}'
      )
  elif isinstance(max_ids_per_table, int):
    max_ids_per_table = [max_ids_per_table] * len(vocab_sizes)
  elif max_ids_per_table is not None:
    raise ValueError(
        'max_ids_per_table is not either a list or an int or None, got '
        f'{type(max_ids_per_table)}'
    )

  if isinstance(max_unique_ids_per_table, List):
    if len(vocab_sizes) != len(max_unique_ids_per_table):
      raise ValueError(
          f'length of vocab_sizes: {len(vocab_sizes)} is not equal to the '
          'length of max_unique_ids_per_table: '
          f'{len(max_unique_ids_per_table)}'
      )
  elif isinstance(max_unique_ids_per_table, int):
    max_unique_ids_per_table = [max_unique_ids_per_table] * len(vocab_sizes)
  elif max_unique_ids_per_table is not None:
    raise ValueError(
        'max_unique_ids_per_table is not either a list or an int or None, '
        f'got {type(max_unique_ids_per_table)}'
    )

  feature_config = {}
  sparsecore_config = None
  max_ids_per_table_dict = {}
  max_unique_ids_per_table_dict = {}

  for i, vocab_size in enumerate(vocab_sizes):

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/recommendation/ranking/task.py:100 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/fcac9bd58b739d2b. Report an issue: GitHub.