{"record":{"id":"f3661d1f22ef4057","repo":"tensorflow/models","slug":"incompatible-resampling-feat-shape-x-target","errorCode":null,"errorMessage":"Incompatible Resampling : feat shape {}x{} target_shape: {}x{}","messagePattern":"Incompatible Resampling : feat shape (.+?)x(.+?) target_shape: (.+?)x(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/vision/modeling/heads/bifpn_head.py","lineNumber":315,"sourceCode":"      target_height, target_width, _ = [target_feat_shape[i] for i in hwc_idx]\n    else:\n      # Default to downsampling if all_feats is empty.\n      target_height, target_width = (height + 1) // 2, (width + 1) // 2\n\n    # If conv_after_downsample is True, when downsampling, apply 1x1 after\n    # downsampling for efficiency.\n    if height > target_height and width > target_width:\n      if not self.conv_after_downsample:\n        feat = self._maybe_apply_1x1(feat, training, num_channels)\n      feat = self._pool2d(feat, height, width, target_height, target_width)\n      if self.conv_after_downsample:\n        feat = self._maybe_apply_1x1(feat, training, num_channels)\n    elif height <= target_height and width <= target_width:\n      feat = self._maybe_apply_1x1(feat, training, num_channels)\n      if height < target_height or width < target_width:\n        feat = self._upsample2d(feat, target_height, target_width, training)\n    else:\n      raise ValueError(\n          'Incompatible Resampling : feat shape {}x{} target_shape: {}x{}'\n          .format(height, width, target_height, target_width))\n\n    return feat\n\n\nclass FNode(tf_keras.layers.Layer):\n  \"\"\"A Keras Layer implementing BiFPN Node.\"\"\"\n\n  def __init__(self,\n               feat_level,\n               inputs_offsets,\n               fpn_num_filters,\n               apply_bn_for_resampling,\n               is_training_bn,\n               conv_after_downsample,\n               conv_bn_act_pattern,\n               conv_type,","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/vision/modeling/heads/bifpn_head.py#L297-L333","documentation":"Error \"Incompatible Resampling : feat shape {}x{} target_shape: {}x{}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/vision/modeling/heads/bifpn_head.py:315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}