{"record":{"id":"71bcda804828f4d4","repo":"tensorflow/models","slug":"unequal-shapes","errorCode":null,"errorMessage":"Unequal shapes {}, {}","messagePattern":"Unequal shapes (.+?), (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/utils/object_detection/shape_utils.py","lineNumber":43,"sourceCode":"\n  If the shapes are dynamic, raises a tf InvalidArgumentError when the shapes\n  mismatch.\n\n  Args:\n    shape_a: a list containing shape of the first tensor.\n    shape_b: a list containing shape of the second tensor.\n\n  Returns:\n    Either a tf.no_op() when shapes are all static and a tf.assert_equal() op\n    when the shapes are dynamic.\n\n  Raises:\n    ValueError: When shapes are both static and unequal.\n  \"\"\"\n  if (all(isinstance(dim, int) for dim in shape_a) and\n      all(isinstance(dim, int) for dim in shape_b)):\n    if shape_a != shape_b:\n      raise ValueError('Unequal shapes {}, {}'.format(shape_a, shape_b))\n    else:\n      return tf.no_op()\n  else:\n    return tf.assert_equal(shape_a, shape_b)\n\n\ndef combined_static_and_dynamic_shape(tensor):\n  \"\"\"Returns a list containing static and dynamic values for the dimensions.\n\n  Returns a list of static and dynamic values for shape dimensions. This is\n  useful to preserve static shapes when available in reshape operation.\n\n  Args:\n    tensor: A tensor of any type.\n\n  Returns:\n    A list of size tensor.shape.ndims containing integers or a scalar tensor.\n  \"\"\"","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/utils/object_detection/shape_utils.py#L25-L61","documentation":"Error \"Unequal shapes {}, {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/utils/object_detection/shape_utils.py:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make the two shapes equal before combining the tensors.","Broadcast or reshape one operand so both shapes match."],"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"}