{"record":{"id":"c480359083e3623d","repo":"tensorflow/models","slug":"number-of-groups-should-be-greater-than-1-and-less","errorCode":null,"errorMessage":"Number of groups should be greater than 1 and less than the output filters.","messagePattern":"Number of groups should be greater than 1 and less than the output filters\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/vision/modeling/custom_layers.py","lineNumber":314,"sourceCode":"      data_format: The ordering of the dimensions in the inputs. `channels_last`\n        corresponds to inputs with shape `(batch_size, height, width, channels)`\n      padding: one of `\"valid\"` or `\"same\"` (case-insensitive).\n      **kwargs: Additional keyword arguments passed to the underlying conv\n        layers.\n\n    Raises:\n      ValueError: if groups < 1 or groups > filters\n      ValueError: if `batch_norm_layer` is not a callable when provided.\n      ValueError: if `data_format` is not channels_last\n      ValueError: if `padding` is not `same` or `valid`.\n    \"\"\"\n    super().__init__()\n    self.conv_layers = []\n    self.bn_layers = []\n    per_conv_filter_size = filters / groups\n\n    if groups <= 1 or groups >= filters:\n      raise ValueError('Number of groups should be greater than 1 and less '\n                       'than the output filters.')\n\n    self.batch_norm_layer = batch_norm_layer\n    self.use_batch_norm = False\n    if self.batch_norm_layer is not None:\n      if not inspect.isclass(self.batch_norm_layer):  # pytype: disable=not-supported-yet\n        raise ValueError('batch_norm_layer is not a class.')\n      self.use_batch_norm = True\n\n    if 'activation' in kwargs.keys():\n      self.activation = tf_keras.activations.get(kwargs['activation'])\n      kwargs.pop('activation')\n    else:\n      self.activation = None\n\n    if data_format != 'channels_last':\n      raise ValueError(\n          'GroupConv2D expects input to be in channels_last format.')","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/vision/modeling/custom_layers.py#L296-L332","documentation":"Error \"Number of groups should be greater than 1 and less than the output filters.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/vision/modeling/custom_layers.py:314 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"}