{"record":{"id":"d1fee0e7136737e7","repo":"tensorflow/models","slug":"the-block-spec-values-do-not-match-with-the-sch","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/mobiledet.py","lineNumber":327,"sourceCode":"      be to set this value in (0, 1) to reduce the number of parameters or\n      computation cost of the model.\n    divisible_by: An `int` that ensures all inner dimensions are divisible by\n      this number.\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  if len(block_specs[0]) != len(block_spec_schema):\n    raise ValueError('The block spec values {} do not match with '\n                     'the schema {}'.format(block_specs[0], block_spec_schema))\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  for ds in decoded_specs:\n    if ds.filters:\n      ds.filters = nn_layers.round_filters(filters=ds.filters,\n                                           multiplier=filter_size_scale,\n                                           divisor=divisible_by,\n                                           round_down_protect=False,\n                                           min_depth=8)\n\n  return decoded_specs\n","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/mobiledet.py#L309-L345","documentation":"Error \"The block spec values {} do not match with the schema {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/mobiledet.py:327 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 mobiledet.py and add/remove keys to match."],"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"}