tensorflow/models · error · ValueError
embedding_dim is not either a list or an int, got {type(embe
Error message
embedding_dim is not either a list or an int, got {type(embedding_dim)} What it means
Error "embedding_dim is not either a list or an int, got {type(embedding_dim)}" thrown in tensorflow/models.
Source
Thrown at official/recommendation/ranking/task.py:79
max_unique_ids_per_table: Maximum number of unique embedding ids per table.
allow_id_dropping: bool to allow id dropping.
initialize_tables_on_host: bool : if the embedding table size is more than
what HBM can handle, this flag will help initialize the full embedding
tables on host and then copy shards to HBM.
Returns:
A dictionary of feature_name, FeatureConfig pairs.
"""
if isinstance(embedding_dim, List):
if len(vocab_sizes) != len(embedding_dim):
raise ValueError(
f'length of vocab_sizes: {len(vocab_sizes)} is not equal to the '
f'length of embedding_dim: {len(embedding_dim)}'
)
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)}'
)
View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/recommendation/ranking/task.py:79 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/55a6a65c64ffc5a5.
Report an issue: GitHub.