{"record":{"id":"bba682b8cce693f9","repo":"tensorflow/models","slug":"unsupported-activation-bba682","errorCode":null,"errorMessage":"Unsupported activation `{}`.","messagePattern":"Unsupported activation `(.+?)`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/detection/modeling/architecture/nn_ops.py","lineNumber":75,"sourceCode":"      gamma_initializer = tf_keras.initializers.Zeros()\n    else:\n      gamma_initializer = tf_keras.initializers.Ones()\n    self._normalization_op = tf_keras.layers.BatchNormalization(\n        momentum=momentum,\n        epsilon=epsilon,\n        center=True,\n        scale=True,\n        trainable=trainable,\n        fused=fused,\n        gamma_initializer=gamma_initializer,\n        name=name)\n    self._use_activation = use_activation\n    if activation == 'relu':\n      self._activation_op = tf.nn.relu\n    elif activation == 'swish':\n      self._activation_op = tf.nn.swish\n    else:\n      raise ValueError('Unsupported activation `{}`.'.format(activation))\n\n  def __call__(self, inputs, is_training=None):\n    \"\"\"Builds the normalization layer followed by an optional activation layer.\n\n    Args:\n      inputs: `Tensor` of shape `[batch, channels, ...]`.\n      is_training: `boolean`, if True if model is in training mode.\n\n    Returns:\n      A normalized `Tensor` with the same `data_format`.\n    \"\"\"\n    # We will need to keep training=None by default, so that it can be inherit\n    # from keras.Model.training\n    if is_training and self.trainable:\n      is_training = True\n    inputs = self._normalization_op(inputs, training=is_training)\n\n    if self._use_activation:","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/modeling/architecture/nn_ops.py#L57-L93","documentation":"Error \"Unsupported activation `{}`.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/modeling/architecture/nn_ops.py:75 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"}