{"record":{"id":"e985cbae8d114b68","repo":"tensorflow/models","slug":"number-of-groups-groups-should-be-greater-than-1","errorCode":null,"errorMessage":"Number of groups {groups} should be greater than 1 and less or equal than the output filters {filters}.","messagePattern":"Number of groups (.+?) should be greater than 1 and less or equal than the output filters (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/vision/modeling/custom_layers.py","lineNumber":109,"sourceCode":"    Input shape:\n      4D tensor with shape: `(batch_size, rows, cols, channels)`\n    Output shape:\n      4D tensor with shape: `(batch_size, new_rows, new_cols, filters)` `rows`\n        and `cols` values might have changed due to padding.\n\n    Returns:\n      A tensor of rank 4 representing\n      `activation(GroupConv2D(inputs, kernel) + bias)`.\n\n    Raises:\n      ValueError: if groups < 1 or groups > filters\n      ValueError: if data_format is not \"channels_last\".\n      ValueError: if `padding` is not `same` or `valid`.\n      ValueError: if `batch_norm_layer` is not a callable when provided.\n      ValueError: when both `strides` > 1 and `dilation_rate` > 1.\n    \"\"\"\n    if groups <= 1 or groups > filters:\n      raise ValueError(f'Number of groups {groups} should be greater than 1 and'\n                       f' less or equal than the output filters {filters}.')\n    self._groups = groups\n    if data_format != 'channels_last':\n      raise ValueError(\n          'GroupConv2D expects input to be in channels_last format.')\n\n    if padding.lower() not in ('same', 'valid'):\n      raise ValueError('Valid padding options are : same, or valid.')\n\n    self.use_batch_norm = False\n    if batch_norm_layer is not None:\n      if not inspect.isclass(batch_norm_layer):\n        raise ValueError('batch_norm_layer is not a class.')\n      self.use_batch_norm = True\n    self.bn_epsilon = bn_epsilon\n    self.bn_momentum = bn_momentum\n    self.batch_norm_layer = []\n    if self.use_batch_norm:","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/vision/modeling/custom_layers.py#L91-L127","documentation":"Error \"Number of groups {groups} should be greater than 1 and less or equal than the output filters {filters}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/vision/modeling/custom_layers.py:109 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"}