{"record":{"id":"e63a42e22bb4e6f5","repo":"tensorflow/models","slug":"the-block-spec-values-do-not-match-with-the-sch-e63a42","errorCode":null,"errorMessage":"The block spec values {} do not match with the schema {}","messagePattern":"The block spec values (.+?) do not match with the schema (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/backbones/mobilenet.py","lineNumber":1188,"sourceCode":"    finegrain_classification_mode: If True, the model will keep the last layer\n      large even for small multipliers, following\n      https://arxiv.org/abs/1801.04381.\n\n  Returns:\n    A list of `BlockSpec` that defines structure of the base network.\n  \"\"\"\n\n  spec_name = specs['spec_name']\n  block_spec_schema = specs['block_spec_schema']\n  block_specs = specs['block_specs']\n\n  if not block_specs:\n    raise ValueError(\n        'The block spec cannot be empty for {} !'.format(spec_name))\n\n  for block_spec in block_specs:\n    if len(block_spec) != len(block_spec_schema):\n      raise ValueError(\n          'The block spec values {} do not match with the schema {}'.format(\n              block_spec, block_spec_schema\n          )\n      )\n\n  decoded_specs = []\n\n  for s in block_specs:\n    kw_s = dict(zip(block_spec_schema, s))\n    decoded_specs.append(BlockSpec(**kw_s))\n\n  # This adjustment applies to V2, V3, and V4\n  if (spec_name != 'MobileNetV1'\n      and finegrain_classification_mode\n      and filter_size_scale < 1.0):\n    decoded_specs[-1].filters /= filter_size_scale  # pytype: disable=annotation-type-mismatch\n\n  for ds in decoded_specs:","sourceCodeStart":1170,"sourceCodeEnd":1206,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/mobilenet.py#L1170-L1206","documentation":"Error \"The block spec values {} do not match with the schema {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/mobilenet.py:1188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make each block spec dict contain exactly the keys required by the schema shown in the error.","Compare your custom block spec with the *_BLOCK_SPECS schema in mobilenet.py and fix the keys."],"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"}