{"record":{"id":"8732c70fdc551207","repo":"tensorflow/models","slug":"the-block-spec-cannot-be-empty-for-8732c7","errorCode":null,"errorMessage":"The block spec cannot be empty for {} !","messagePattern":"The block spec cannot be empty for (.+?) !","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/backbones/mobilenet.py","lineNumber":1183,"sourceCode":"      convolution ops. The value must be greater than zero. Typical usage will\n      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    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'","sourceCodeStart":1165,"sourceCodeEnd":1201,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/backbones/mobilenet.py#L1165-L1201","documentation":"Error \"The block spec cannot be empty for {} !\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/backbones/mobilenet.py:1183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty block spec for the named block group in the MobileNet backbone config.","Use a built-in MobileNet architecture (e.g. 'mobilenet_v2') instead of an empty custom spec."],"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"}