tensorflow/models · error · ValueError

Attribute head type {} not supported.

Error message

Attribute head type {} not supported.

What it means

Error "Attribute head type {} not supported." thrown in tensorflow/models.

Source

Thrown at official/vision/modeling/heads/dense_prediction_heads.py:247

          'kernel_size': 3,
          'padding': 'same',
          'bias_initializer': tf.zeros_initializer(),
          'bias_regularizer': self._config_dict['bias_regularizer'],
      }
      if att_type == 'regression':
        att_predictor_kwargs.update(
            {'bias_initializer': tf.zeros_initializer()}
        )
      elif att_type == 'classification':
        att_predictor_kwargs.update(
            {
                'bias_initializer': tf.constant_initializer(
                    -np.log((1 - 0.01) / 0.01)
                )
            }
        )
      else:
        raise ValueError(
            'Attribute head type {} not supported.'.format(att_type)
        )

      if (
          att_prediction_tower_name
          and self._config_dict['share_classification_heads']
      ):
        raise ValueError(
            'share_classification_heads cannot be set as True when'
            ' att_prediction_tower_name is specified.'
        )

      if not self._config_dict['use_separable_conv']:
        att_predictor_kwargs.update({
            'kernel_initializer': tf_keras.initializers.RandomNormal(
                stddev=1e-5
            ),
            'kernel_regularizer': self._config_dict['kernel_regularizer'],

View on GitHub (pinned to e006f5f0d5)

Solutions

  1. Use a supported attribute head type (e.g. 'regression' or 'classification') in the dense prediction head config.
  2. Check the attribute head 'type' field for typos.

When it happens

Trigger: Thrown at official/vision/modeling/heads/dense_prediction_heads.py:247 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/b943ece718cb84bd. Report an issue: GitHub.