{"record":{"id":"d53dace4729ca5e7","repo":"tensorflow/models","slug":"sigma-should-be-a-float-or-a-tuple-list-of-2-float","errorCode":null,"errorMessage":"sigma should be a float or a tuple/list of 2 floats","messagePattern":"sigma should be a float or a tuple/list of 2 floats","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/ops/augment.py","lineNumber":232,"sourceCode":"      `tf.pad`. For more details, please refer to\n      https://www.tensorflow.org/api_docs/python/tf/pad.\n    constant_values: A `scalar`, the pad value to use in \"CONSTANT\" padding\n      mode.\n    name: A name for this operation (optional).\n\n  Returns:\n    2-D, 3-D or 4-D `Tensor` of the same dtype as input.\n\n  Raises:\n    ValueError: If `image` is not 2, 3 or 4-dimensional,\n      if `padding` is other than \"REFLECT\", \"CONSTANT\" or \"SYMMETRIC\",\n      if `filter_shape` is invalid,\n      or if `sigma` is invalid.\n  \"\"\"\n  with tf.name_scope(name or 'gaussian_filter2d'):\n    if isinstance(sigma, (list, tuple)):\n      if len(sigma) != 2:\n        raise ValueError('sigma should be a float or a tuple/list of 2 floats')\n    else:\n      sigma = (sigma,) * 2\n\n    if any(s < 0 for s in sigma):\n      raise ValueError('sigma should be greater than or equal to 0.')\n\n    image = tf.convert_to_tensor(image, name='image')\n    sigma = tf.convert_to_tensor(sigma, name='sigma')\n\n    original_ndims = tf.rank(image)\n    image = to_4d(image)\n\n    # Keep the precision if it's float;\n    # otherwise, convert to float32 for computing.\n    orig_dtype = image.dtype\n    if not image.dtype.is_floating:\n      image = tf.cast(image, tf.float32)\n","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/ops/augment.py#L214-L250","documentation":"Error \"sigma should be a float or a tuple/list of 2 floats\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/ops/augment.py:232 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass sigma as a single float or a tuple/list of 2 floats [low, high].","Fix the sigma type in the augmentation config."],"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"}