tensorflow/models · error · ValueError

max_ids_per_table is not either a list or an int or None, go

Error message

max_ids_per_table is not either a list or an int or None, got {type(max_ids_per_table)}

What it means

Error "max_ids_per_table is not either a list or an int or None, got {type(max_ids_per_table)}" thrown in tensorflow/models.

Source

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

      )
  elif isinstance(embedding_dim, int):
    embedding_dim = [embedding_dim] * len(vocab_sizes)
  else:
    raise ValueError(
        'embedding_dim is not either a list or an int, got '
        f'{type(embedding_dim)}'
    )

  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)}'
    )

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/recommendation/ranking/task.py:93 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/017ca421c2774827. Report an issue: GitHub.