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/modeling/mosaic_blocks.py:367
kernel_size=(1, 1),
padding='same',
activation=None,
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 = tf_keras.layers.AveragePooling2D(
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 = MultiKernelGroupConvBlock(
output_filter_depths=self._branch_filter_depths,View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/mosaic/modeling/mosaic_blocks.py:367 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/d9accd6f767ddba8.
Report an issue: GitHub.