tensorflow/models · error · ValueError

Unsupported block_type {self._block_type[i]}

Error message

Unsupported block_type {self._block_type[i]}

What it means

Error "Unsupported block_type {self._block_type[i]}" thrown in tensorflow/models.

Source

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

              pool_type=self._pool_type,
              pool_stride=pool_stride,
              dropcnn=self._dropcnn,
              dropatt=self._dropatt,
              dropout=self._dropout,
              rel_attn_type=self._rel_attn_type,
              scale_ratio=self._scale_ratio,
              survival_prob=survival_prob,
              ln_epsilon=self._ln_epsilon,
              ln_dtype=self._ln_dtype,
              norm_type=self._norm_type,
              bn_epsilon=self._bn_epsilon,
              bn_momentum=self._bn_momentum,
              kernel_initializer=self._kernel_initializer,
              bias_initializer=self._bias_initializer,
              name=block_name,
          )
        else:
          raise ValueError(f'Unsupported block_type {self._block_type[i]}')
        self._blocks[-1].append(block)
        bid += 1

    if self._representation_size and self._representation_size > 0:
      self._dense = tf_keras.layers.Dense(
          self._representation_size, name='pre_logits')
      if self._add_gap_layer_norm:
        self._final_layer_norm = tf_keras.layers.LayerNormalization(
            epsilon=self._ln_epsilon, name='final_layer_norm')

  def _add_absolute_position_encoding(self, inputs: tf.Tensor) -> tf.Tensor:
    """Add absolute sinusoid position encoding, which is computed on the fly."""
    output = ops.maybe_reshape_to_2d(inputs)
    h, w = tf.shape(output)[1], tf.shape(output)[2]
    enc_size = output.shape.as_list()[-1] // 2
    # sinusoid positional encoding that can be generated online
    h_seq = tf.range(-h / 2, h / 2)
    w_seq = tf.range(-w / 2, w / 2)

View on GitHub (pinned to e006f5f0d5)

When it happens

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