{"record":{"id":"e5cafa13af6ebe2f","repo":"tensorflow/models","slug":"invalid-num-convs-att-num-convs-for-att-name","errorCode":null,"errorMessage":"Invalid `num_convs` {att_num_convs} for {att_name}.","messagePattern":"Invalid `num_convs` (.+?) for (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/heads/dense_prediction_heads.py","lineNumber":386,"sourceCode":"    return convs, norms, predictors\n\n  def _build_attribute_net(self, conv_op, bn_op):\n    self._att_predictors = {}\n    self._att_convs = {}\n    self._att_norms = {}\n\n    for att_config, att_predictor_kwargs in zip(\n        self._config_dict['attribute_heads'], self._attribute_kwargs  # pyrefly: ignore[bad-argument-type]\n    ):\n      att_name = att_config['name']\n      att_num_convs = (\n          att_config.get('num_convs') or self._config_dict['num_convs']\n      )\n      att_num_filters = (\n          att_config.get('num_filters') or self._config_dict['num_filters']\n      )\n      if att_num_convs < 0:\n        raise ValueError(f'Invalid `num_convs` {att_num_convs} for {att_name}.')\n      if att_num_filters < 0:\n        raise ValueError(\n            f'Invalid `num_filters` {att_num_filters} for {att_name}.'\n        )\n      att_conv_kwargs = self._conv_kwargs.copy()\n      att_conv_kwargs['filters'] = att_num_filters\n      att_convs_i = []\n      att_norms_i = []\n\n      # Build conv and norm layers.\n      for level in range(\n          self._config_dict['min_level'], self._config_dict['max_level'] + 1\n      ):\n        this_level_att_norms = []\n        for i in range(att_num_convs):\n          if level == self._config_dict['min_level']:\n            att_conv_name = '{}-conv_{}'.format(att_name, i)\n            att_convs_i.append(conv_op(name=att_conv_name, **att_conv_kwargs))","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/heads/dense_prediction_heads.py#L368-L404","documentation":"Error \"Invalid `num_convs` {att_num_convs} for {att_name}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/heads/dense_prediction_heads.py:386 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the attribute's num_convs to a non-negative integer in the head config.","Remove num_convs for that attribute to use the default tower depth."],"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"}