{"record":{"id":"0cf631a00904ee14","repo":"tensorflow/models","slug":"share-classification-heads-cannot-be-set-as-true-w","errorCode":null,"errorMessage":"share_classification_heads cannot be set as True when att_prediction_tower_name is specified.","messagePattern":"share_classification_heads cannot be set as True when att_prediction_tower_name is specified\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/modeling/heads/dense_prediction_heads.py","lineNumber":255,"sourceCode":"        )\n      elif att_type == 'classification':\n        att_predictor_kwargs.update(\n            {\n                'bias_initializer': tf.constant_initializer(\n                    -np.log((1 - 0.01) / 0.01)\n                )\n            }\n        )\n      else:\n        raise ValueError(\n            'Attribute head type {} not supported.'.format(att_type)\n        )\n\n      if (\n          att_prediction_tower_name\n          and self._config_dict['share_classification_heads']\n      ):\n        raise ValueError(\n            'share_classification_heads cannot be set as True when'\n            ' att_prediction_tower_name is specified.'\n        )\n\n      if not self._config_dict['use_separable_conv']:\n        att_predictor_kwargs.update({\n            'kernel_initializer': tf_keras.initializers.RandomNormal(\n                stddev=1e-5\n            ),\n            'kernel_regularizer': self._config_dict['kernel_regularizer'],\n        })\n      self._attribute_kwargs.append(att_predictor_kwargs)\n\n  def _apply_prediction_tower(self, features, convs, norms) -> tf.Tensor:\n    x = features\n    for conv, norm in zip(convs, norms):\n      x = conv(x)\n      x = norm(x)","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/modeling/heads/dense_prediction_heads.py#L237-L273","documentation":"Error \"share_classification_heads cannot be set as True when att_prediction_tower_name is specified.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/modeling/heads/dense_prediction_heads.py:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set share_classification_heads to False when att_prediction_tower_name is specified.","Remove att_prediction_tower_name if you want to share classification heads across attributes."],"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"}