tensorflow/models · error · ValueError

The number of pooling bins must be smaller than input sizes.

Error message

The number of pooling bins must be smaller than input sizes.

What it means

Error "The number of pooling bins must be smaller than input sizes." thrown in tensorflow/models.

Source

Thrown at official/projects/mosaic/qat/modeling/layers/nn_blocks.py:185

            kernel_size=(1, 1),
            padding='same',
            activation=helper.NoOpActivation(),
            kernel_regularizer=self._kernel_regularizer,
            kernel_initializer=self._kernel_initializer,
            use_bias=False)
        batch_norm_global_branch = self._bn_op(
            axis=self._bn_axis,
            momentum=self._batchnorm_momentum,
            epsilon=self._batchnorm_epsilon)
        # Use list manually instead of tf_keras.Sequential([])
        self._global_pool_branch = [
            global_pool,
            global_projection,
            batch_norm_global_branch,
        ]
      else:
        if height < pyramid_pool_bin_num or width < pyramid_pool_bin_num:
          raise ValueError('The number of pooling bins must be smaller than '
                           'input sizes.')
        assert pyramid_pool_bin_num >= 2, (
            'Except for the gloabl pooling, the number of bins in pyramid '
            'pooling must be at least two.')
        pool_height, stride_height = self._get_bin_pool_kernel_and_stride(
            height, pyramid_pool_bin_num)
        pool_width, stride_width = self._get_bin_pool_kernel_and_stride(
            width, pyramid_pool_bin_num)
        bin_pool_level = helper.AveragePooling2DQuantized(
            pool_size=(pool_height, pool_width),
            strides=(stride_height, stride_width),
            padding='valid',
            data_format=self._data_format)
        self._spatial_pyramid.append(bin_pool_level)

    # Grouped multi-kernel Convolution.
    self._multi_kernel_group_conv = MultiKernelGroupConvBlockQuantized(
        output_filter_depths=self._branch_filter_depths,

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: Thrown at official/projects/mosaic/qat/modeling/layers/nn_blocks.py:185 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/2ca8d14f041b4e35. Report an issue: GitHub.