{"record":{"id":"7dea80e52a1981db","repo":"tensorflow/models","slug":"unknown-order","errorCode":null,"errorMessage":"Unknown order {}","messagePattern":"Unknown order (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/pix2seq/utils.py","lineNumber":343,"sourceCode":"  if order == 'none':\n    return classes, boxes\n\n  assert boxes.shape.rank == 2, 'Must be unbatched'\n  boxes = tf.reshape(boxes, [-1, 2, 2])\n\n  if order == 'random':\n    idx = tf.random.shuffle(tf.range(tf.shape(boxes)[0]))\n  elif order == 'area':\n    areas = tf.cast(\n        tf.reduce_prod(boxes[:, 1, :] - boxes[:, 0, :], axis=1), tf.int64\n    )  # approximated size.\n    idx = tf.argsort(areas, direction='DESCENDING')\n  elif order == 'dist2ori':\n    y, x = boxes[:, 0], boxes[:, 1]  # using top-left corner.\n    dist2ori = tf.square(y) + tf.square(x)\n    idx = tf.argsort(dist2ori, direction='ASCENDING')\n  else:\n    raise ValueError('Unknown order {}'.format(order))\n\n  boxes = tf.reshape(boxes, [-1, 4])\n  boxes = tf.gather(boxes, idx)\n  classes = tf.gather(classes, idx)\n\n  return boxes, classes\n\n\ndef scale_points(points, scale):\n  \"\"\"Scales points.\n\n  Args:\n    points: Tensor with shape [num_points * 2], [batch, num_points * 2] or\n      [batch, instances, num_points * 2] where points are organized in (y, x)\n      format.\n    scale: Tensor with shape [2] or [batch, 2].\n\n  Returns:","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/pix2seq/utils.py#L325-L361","documentation":"Error \"Unknown order {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/pix2seq/utils.py:343 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"}