{"record":{"id":"bb6d8a7f2f3ebbde","repo":"tensorflow/models","slug":"length-of-vocab-sizes-len-vocab-sizes-is-not-e","errorCode":null,"errorMessage":"length of vocab_sizes: {len(vocab_sizes)} is not equal to the length of embedding_dim: {len(embedding_dim)}","messagePattern":"length of vocab_sizes: (.+?) is not equal to the length of embedding_dim: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/recommendation/ranking/task.py","lineNumber":72,"sourceCode":"    vocab_sizes: List of sizes of categories/id's in the table.\n    embedding_dim: An integer or a list of embedding table dimensions.\n    table_name_prefix: a prefix for embedding tables.\n    batch_size: Per-replica batch size.\n    max_ids_per_chip_per_sample: Maximum number of embedding ids per chip per\n      sample.\n    max_ids_per_table: Maximum number of embedding ids per table.\n    max_unique_ids_per_table: Maximum number of unique embedding ids per table.\n    allow_id_dropping: bool to allow id dropping.\n    initialize_tables_on_host: bool : if the embedding table size is more than \n      what HBM can handle, this flag will help initialize the full embedding\n      tables on host and then copy shards to HBM.\n\n  Returns:\n    A dictionary of feature_name, FeatureConfig pairs.\n  \"\"\"\n  if isinstance(embedding_dim, List):\n    if len(vocab_sizes) != len(embedding_dim):\n      raise ValueError(\n          f'length of vocab_sizes: {len(vocab_sizes)} is not equal to the '\n          f'length of embedding_dim: {len(embedding_dim)}'\n      )\n  elif isinstance(embedding_dim, int):\n    embedding_dim = [embedding_dim] * len(vocab_sizes)\n  else:\n    raise ValueError(\n        'embedding_dim is not either a list or an int, got '\n        f'{type(embedding_dim)}'\n    )\n\n  if isinstance(max_ids_per_table, List):\n    if len(vocab_sizes) != len(max_ids_per_table):\n      raise ValueError(\n          f'length of vocab_sizes: {len(vocab_sizes)} is not equal to the '\n          f'length of max_ids_per_table: {len(max_ids_per_table)}'\n      )\n  elif isinstance(max_ids_per_table, int):","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/recommendation/ranking/task.py#L54-L90","documentation":"Error \"length of vocab_sizes: {len(vocab_sizes)} is not equal to the length of embedding_dim: {len(embedding_dim)}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/recommendation/ranking/task.py:72 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":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}