tensorflow/models · error · ValueError

The minimum backbone level

Error message

The minimum backbone level %d should be less or equal to FPN minimum level %d.:

What it means

Level-consistency guard when building/ applying the FPN: the backbone's minimum output feature level exceeds the FPN's configured min_level, so the pyramid cannot be constructed — FPN must consume levels at least as fine as its own minimum. The two numbers in the message are the backbone min level and the FPN min level.

Solutions

  1. Raise fpn.min_level to at least the backbone's minimum level (e.g. set min_level=3 for a ResNet backbone starting at level 3)
  2. Or use a backbone that emits finer feature levels
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at official/legacy/detection/modeling/architecture/fpn.py:119 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/20974586bbc8f750. Report an issue: GitHub.

Appendix: source

Thrown at official/legacy/detection/modeling/architecture/fpn.py:119

          name='p%d' % level)

  def __call__(self, multilevel_features, is_training=None):
    """Returns the FPN features for a given multilevel features.

    Args:
      multilevel_features: a `dict` containing `int` keys for continuous feature
        levels, e.g., [2, 3, 4, 5]. The values are corresponding features with
        shape [batch_size, height_l, width_l, num_filters].
      is_training: `bool` if True, the model is in training mode.

    Returns:
      a `dict` containing `int` keys for continuous feature levels
      [min_level, min_level + 1, ..., max_level]. The values are corresponding
      FPN features with shape [batch_size, height_l, width_l, fpn_feat_dims].
    """
    input_levels = list(multilevel_features.keys())
    if min(input_levels) > self._min_level:
      raise ValueError(
          'The minimum backbone level %d should be '%(min(input_levels)) +
          'less or equal to FPN minimum level %d.:'%(self._min_level))
    backbone_max_level = min(max(input_levels), self._max_level)
    with tf.name_scope('fpn'):
      # Adds lateral connections.
      feats_lateral = {}
      for level in range(self._min_level, backbone_max_level + 1):
        feats_lateral[level] = self._lateral_conv2d_op[level](
            multilevel_features[level])

      # Adds top-down path.
      feats = {backbone_max_level: feats_lateral[backbone_max_level]}
      for level in range(backbone_max_level - 1, self._min_level - 1, -1):
        feats[level] = spatial_transform_ops.nearest_upsampling(
            feats[level + 1], 2) + feats_lateral[level]

      # Adds post-hoc 3x3 convolution kernel.
      for level in range(self._min_level, backbone_max_level + 1):

View on GitHub (pinned to e006f5f0d5)