{"record":{"id":"e2d5c7c31b584e9d","repo":"tensorflow/models","slug":"unsupported-pooling-type","errorCode":null,"errorMessage":"Unsupported pooling type {}.","messagePattern":"Unsupported pooling type (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/vision/modeling/heads/bifpn_head.py","lineNumber":262,"sourceCode":"  def _pool2d(self, inputs, height, width, target_height, target_width):\n    \"\"\"Pools the inputs to target height and width.\"\"\"\n    height_stride_size = int((height - 1) // target_height + 1)\n    width_stride_size = int((width - 1) // target_width + 1)\n    if self.pooling_type == 'max':\n      return tf_keras.layers.MaxPooling2D(\n          pool_size=[height_stride_size + 1, width_stride_size + 1],\n          strides=[height_stride_size, width_stride_size],\n          padding='SAME',\n          data_format=self.data_format)(\n              inputs)\n    if self.pooling_type == 'avg':\n      return tf_keras.layers.AveragePooling2D(\n          pool_size=[height_stride_size + 1, width_stride_size + 1],\n          strides=[height_stride_size, width_stride_size],\n          padding='SAME',\n          data_format=self.data_format)(\n              inputs)\n    raise ValueError('Unsupported pooling type {}.'.format(self.pooling_type))\n\n  def _upsample2d(self, inputs, target_height, target_width, training):\n    return resize(inputs, target_height, target_width, self.strategy, training,\n                  self.upsampling_type)\n\n  def _maybe_apply_1x1(self, feat, training, num_channels):\n    \"\"\"Applies 1x1 conv to change layer width if necessary.\"\"\"\n    target_num_channels = self.target_num_channels\n    if target_num_channels is None or num_channels != target_num_channels:\n      feat = self.conv2d(feat)\n      if self.apply_bn:\n        feat = self.bn(feat, training=training)\n    return feat\n\n  def build(self, feat_shape):\n    num_channels = self.target_num_channels or feat_shape[-1]\n    self.conv2d = tf_keras.layers.Conv2D(\n        num_channels, (1, 1),","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/vision/modeling/heads/bifpn_head.py#L244-L280","documentation":"Error \"Unsupported pooling type {}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/vision/modeling/heads/bifpn_head.py:262 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"}