tensorflow/models · error · ValueError

Incompatible Resampling : feat shape {}x{} target_shape: {}x

Error message

Incompatible Resampling : feat shape {}x{} target_shape: {}x{}

What it means

Error "Incompatible Resampling : feat shape {}x{} target_shape: {}x{}" thrown in tensorflow/models.

Source

Thrown at official/projects/edgetpu/vision/modeling/heads/bifpn_head.py:315

      target_height, target_width, _ = [target_feat_shape[i] for i in hwc_idx]
    else:
      # Default to downsampling if all_feats is empty.
      target_height, target_width = (height + 1) // 2, (width + 1) // 2

    # If conv_after_downsample is True, when downsampling, apply 1x1 after
    # downsampling for efficiency.
    if height > target_height and width > target_width:
      if not self.conv_after_downsample:
        feat = self._maybe_apply_1x1(feat, training, num_channels)
      feat = self._pool2d(feat, height, width, target_height, target_width)
      if self.conv_after_downsample:
        feat = self._maybe_apply_1x1(feat, training, num_channels)
    elif height <= target_height and width <= target_width:
      feat = self._maybe_apply_1x1(feat, training, num_channels)
      if height < target_height or width < target_width:
        feat = self._upsample2d(feat, target_height, target_width, training)
    else:
      raise ValueError(
          'Incompatible Resampling : feat shape {}x{} target_shape: {}x{}'
          .format(height, width, target_height, target_width))

    return feat


class FNode(tf_keras.layers.Layer):
  """A Keras Layer implementing BiFPN Node."""

  def __init__(self,
               feat_level,
               inputs_offsets,
               fpn_num_filters,
               apply_bn_for_resampling,
               is_training_bn,
               conv_after_downsample,
               conv_bn_act_pattern,
               conv_type,

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/edgetpu/vision/modeling/heads/bifpn_head.py:315 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/f3661d1f22ef4057. Report an issue: GitHub.