tensorflow/models · error · ValueError

Unsupported norm_type {self._norm_type}.

Error message

Unsupported norm_type {self._norm_type}.

What it means

Error "Unsupported norm_type {self._norm_type}." thrown in tensorflow/models.

Source

Thrown at official/projects/maxvit/modeling/maxvit.py:590

    if self._norm_type == 'layer_norm':
      bn_class = functools.partial(
          tf_keras.layers.LayerNormalization, epsilon=self._ln_epsilon
      )
    elif self._norm_type == 'batch_norm':
      bn_class = functools.partial(
          tf_keras.layers.BatchNormalization,
          momentum=self._bn_momentum,
          epsilon=self._bn_epsilon,
      )
    elif self._norm_type == 'sync_batch_norm':
      bn_class = functools.partial(
          tf_keras.layers.BatchNormalization,
          momentum=self._bn_momentum,
          epsilon=self._bn_epsilon,
          synchronized=True,
      )
    else:
      raise ValueError(f'Unsupported norm_type {self._norm_type}.')

    _, self.height, self.width, _ = input_shape.as_list()
    logging.info(
        f'Build backbone with input size: ({self.height}, {self.width}).'
    )

    # Stem
    stem_layers = []
    for i, _ in enumerate(self._stem_hsize):
      conv_layer = tf_keras.layers.Conv2D(
          filters=self._stem_hsize[i],
          kernel_size=self._kernel_size,
          strides=2 if i == 0 else 1,
          padding='same',
          data_format=self._data_format,
          kernel_initializer=self._kernel_initializer,
          bias_initializer=self._bias_initializer,
          use_bias=True,

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/maxvit/modeling/maxvit.py:590 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/75df199154c484a4. Report an issue: GitHub.