tensorflow/models · error · ValueError

Stem type not supported.

Error message

Stem type {} not supported.

What it means

Raised in ResNet's _stem when the configured stem_type matches none of the implemented stem variants (the if/elif chain fell through to else). The stem builder cannot construct a frontend for that type string.

Solutions

  1. Use stem_type 'v0' or 'v1' in the ResNet backbone config.
  2. Remove stem_type to use the default stem.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at official/vision/modeling/backbones/resnet.py:296 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/9b427536f8e5db2b. Report an issue: GitHub.

Appendix: source

Thrown at official/vision/modeling/backbones/resnet.py:296

          filters=int(64 * stem_depth_multiplier),
          kernel_size=3,
          strides=1,
          use_bias=False,
          padding='same',
          kernel_initializer=self._kernel_initializer,
          kernel_regularizer=self._kernel_regularizer,
          bias_regularizer=self._bias_regularizer,
      )(x)
      x = self._norm(
          axis=self._bn_axis,
          momentum=self._norm_momentum,
          epsilon=self._norm_epsilon,
          trainable=self._bn_trainable,
          synchronized=self._use_sync_bn,
      )(x)
      x = tf_utils.get_activation(self._activation, use_keras_layer=True)(x)
    else:
      raise ValueError('Stem type {} not supported.'.format(self._stem_type))

    if self._replace_stem_max_pool:
      x = layers.Conv2D(
          filters=int(64 * self._depth_multiplier),
          kernel_size=3,
          strides=2,
          use_bias=False,
          padding='same',
          kernel_initializer=self._kernel_initializer,
          kernel_regularizer=self._kernel_regularizer,
          bias_regularizer=self._bias_regularizer,
      )(x)
      x = self._norm(
          axis=self._bn_axis,
          momentum=self._norm_momentum,
          epsilon=self._norm_epsilon,
          trainable=self._bn_trainable,
          synchronized=self._use_sync_bn,

View on GitHub (pinned to e006f5f0d5)