tensorflow/models · error · ValueError
Number of groups {groups} should be greater than 1 and less
Error message
Number of groups {groups} should be greater than 1 and less or equal than the output filters {filters}. What it means
Error "Number of groups {groups} should be greater than 1 and less or equal than the output filters {filters}." thrown in tensorflow/models.
Source
Thrown at official/projects/edgetpu/vision/modeling/custom_layers.py:109
Input shape:
4D tensor with shape: `(batch_size, rows, cols, channels)`
Output shape:
4D tensor with shape: `(batch_size, new_rows, new_cols, filters)` `rows`
and `cols` values might have changed due to padding.
Returns:
A tensor of rank 4 representing
`activation(GroupConv2D(inputs, kernel) + bias)`.
Raises:
ValueError: if groups < 1 or groups > filters
ValueError: if data_format is not "channels_last".
ValueError: if `padding` is not `same` or `valid`.
ValueError: if `batch_norm_layer` is not a callable when provided.
ValueError: when both `strides` > 1 and `dilation_rate` > 1.
"""
if groups <= 1 or groups > filters:
raise ValueError(f'Number of groups {groups} should be greater than 1 and'
f' less or equal than the output filters {filters}.')
self._groups = groups
if data_format != 'channels_last':
raise ValueError(
'GroupConv2D expects input to be in channels_last format.')
if padding.lower() not in ('same', 'valid'):
raise ValueError('Valid padding options are : same, or valid.')
self.use_batch_norm = False
if batch_norm_layer is not None:
if not inspect.isclass(batch_norm_layer):
raise ValueError('batch_norm_layer is not a class.')
self.use_batch_norm = True
self.bn_epsilon = bn_epsilon
self.bn_momentum = bn_momentum
self.batch_norm_layer = []
if self.use_batch_norm:View on GitHub (pinned to e006f5f0d5)
When it happens
Trigger: Thrown at official/projects/edgetpu/vision/modeling/custom_layers.py:109 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/e985cbae8d114b68.
Report an issue: GitHub.