{"record":{"id":"845206a68c52c8b3","repo":"tensorflow/models","slug":"scale-is-but-outer-box-scale-must-be-greater-t-845206","errorCode":null,"errorMessage":"scale is {}, but outer box scale must be greater than 1.0.","messagePattern":"scale is (.+?), but outer box scale must be greater than 1\\.0\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/ops/box_ops.py","lineNumber":314,"sourceCode":"\ndef compute_outer_boxes(boxes, image_shape, scale=1.0):\n  \"\"\"Computes outer box encloses an object with a margin.\n\n  Args:\n    boxes: a tensor whose last dimension is 4 representing the coordinates of\n      boxes in ymin, xmin, ymax, xmax order.\n    image_shape: a list of two integers, a two-element vector or a tensor such\n      that all but the last dimensions are `broadcastable` to `boxes`. The last\n      dimension is 2, which represents [height, width].\n    scale: a float number specifying the scale of output outer boxes to input\n      `boxes`.\n\n  Returns:\n    outer_boxes: a tensor whose shape is the same as `boxes` representing the\n      outer boxes.\n  \"\"\"\n  if scale < 1.0:\n    raise ValueError(\n        'scale is {}, but outer box scale must be greater than 1.0.'.format(\n            scale))\n  if scale == 1.0:\n    return boxes\n  centers_y = (boxes[..., 0] + boxes[..., 2]) / 2.0\n  centers_x = (boxes[..., 1] + boxes[..., 3]) / 2.0\n  box_height = (boxes[..., 2] - boxes[..., 0]) * scale\n  box_width = (boxes[..., 3] - boxes[..., 1]) * scale\n  outer_boxes = tf.stack(\n      [centers_y - box_height / 2.0, centers_x - box_width / 2.0,\n       centers_y + box_height / 2.0, centers_x + box_width / 2.0],\n      axis=-1)\n  outer_boxes = clip_boxes(outer_boxes, image_shape)\n  return outer_boxes\n\n\ndef encode_boxes(boxes, anchors, weights=None):\n  \"\"\"Encodes boxes to targets.","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/ops/box_ops.py#L296-L332","documentation":"Error \"scale is {}, but outer box scale must be greater than 1.0.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/ops/box_ops.py:314 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set scale to a value greater than 1.0 for the outer box.","Use the default scale or pick a value > 1.0 in the 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"}