{"record":{"id":"0aec244cf94018d2","repo":"tensorflow/models","slug":"output-shape-must-be-a-1-d-tensor-of-2-elements-n","errorCode":null,"errorMessage":"output_shape must be a 1-D Tensor of 2 elements: new_height, new_width, instead got output_shape={output_shape}","messagePattern":"output_shape must be a 1-D Tensor of 2 elements: new_height, new_width, instead got output_shape=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/legacy/image_classification/augment.py","lineNumber":227,"sourceCode":"  Returns:\n    Image(s) with the same type and shape as `images`, with the given\n    transform(s) applied. Transformed coordinates outside of the input image\n    will be filled with zeros.\n  \"\"\"\n  with tf.name_scope(name or 'transform'):\n    if output_shape is None:\n      output_shape = tf.shape(images)[1:3]\n      if not tf.executing_eagerly():\n        output_shape_value = tf.get_static_value(output_shape)\n        if output_shape_value is not None:\n          output_shape = output_shape_value\n\n    output_shape = tf.convert_to_tensor(\n        output_shape, tf.int32, name='output_shape'\n    )\n\n    if not output_shape.get_shape().is_compatible_with([2]):\n      raise ValueError(\n          'output_shape must be a 1-D Tensor of 2 elements: '\n          'new_height, new_width, instead got '\n          f'output_shape={output_shape}'\n      )\n\n    fill_value = tf.convert_to_tensor(fill_value, tf.float32, name='fill_value')\n\n    return tf.raw_ops.ImageProjectiveTransformV3(\n        images=images,\n        output_shape=output_shape,\n        fill_value=fill_value,\n        transforms=transforms,\n        fill_mode=fill_mode.upper(),\n        interpolation=interpolation.upper(),\n    )\n\n\ndef transform(image: tf.Tensor, transforms) -> tf.Tensor:","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/legacy/image_classification/augment.py#L209-L245","documentation":"Error \"output_shape must be a 1-D Tensor of 2 elements: new_height, new_width, instead got output_shape={output_shape}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/legacy/image_classification/augment.py:227 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"}