{"record":{"id":"b7932aa81da27cec","repo":"tensorflow/models","slug":"scale-is-but-outer-box-scale-must-be-greater-t","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/legacy/detection/utils/box_utils.py","lineNumber":237,"sourceCode":"\ndef compute_outer_boxes(boxes, image_shape, scale=1.0):\n  \"\"\"Compute 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  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  ],\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  \"\"\"Encode boxes to targets.\n","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/detection/utils/box_utils.py#L219-L255","documentation":"Error \"scale is {}, but outer box scale must be greater than 1.0.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/detection/utils/box_utils.py:237 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"}