{"record":{"id":"2ca8d14f041b4e35","repo":"tensorflow/models","slug":"the-number-of-pooling-bins-must-be-smaller-than-in-2ca8d1","errorCode":null,"errorMessage":"The number of pooling bins must be smaller than input sizes.","messagePattern":"The number of pooling bins must be smaller than input sizes\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/mosaic/qat/modeling/layers/nn_blocks.py","lineNumber":185,"sourceCode":"            kernel_size=(1, 1),\n            padding='same',\n            activation=helper.NoOpActivation(),\n            kernel_regularizer=self._kernel_regularizer,\n            kernel_initializer=self._kernel_initializer,\n            use_bias=False)\n        batch_norm_global_branch = self._bn_op(\n            axis=self._bn_axis,\n            momentum=self._batchnorm_momentum,\n            epsilon=self._batchnorm_epsilon)\n        # Use list manually instead of tf_keras.Sequential([])\n        self._global_pool_branch = [\n            global_pool,\n            global_projection,\n            batch_norm_global_branch,\n        ]\n      else:\n        if height < pyramid_pool_bin_num or width < pyramid_pool_bin_num:\n          raise ValueError('The number of pooling bins must be smaller than '\n                           'input sizes.')\n        assert pyramid_pool_bin_num >= 2, (\n            'Except for the gloabl pooling, the number of bins in pyramid '\n            'pooling must be at least two.')\n        pool_height, stride_height = self._get_bin_pool_kernel_and_stride(\n            height, pyramid_pool_bin_num)\n        pool_width, stride_width = self._get_bin_pool_kernel_and_stride(\n            width, pyramid_pool_bin_num)\n        bin_pool_level = helper.AveragePooling2DQuantized(\n            pool_size=(pool_height, pool_width),\n            strides=(stride_height, stride_width),\n            padding='valid',\n            data_format=self._data_format)\n        self._spatial_pyramid.append(bin_pool_level)\n\n    # Grouped multi-kernel Convolution.\n    self._multi_kernel_group_conv = MultiKernelGroupConvBlockQuantized(\n        output_filter_depths=self._branch_filter_depths,","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/mosaic/qat/modeling/layers/nn_blocks.py#L167-L203","documentation":"Error \"The number of pooling bins must be smaller than input sizes.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/mosaic/qat/modeling/layers/nn_blocks.py:185 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"}