tf.image.draw_bounding_boxes: Aborted (core dumped)
Hi **@nonenone12135** ,

Sorry for the delay, The error message indicates that the rank of the images should be 4. The tf.image.draw_bounding_boxes function expects the input images to have a rank of 4, which means that the shape of the input images should be [batch_size, height, width, channels].

In the original code, the reshaped_images variable is created by reshaping the input_images tensor to have a shape of [image_height, image_width, num_channels]. This is incorrect because it removes the batch dimension from the tensor.

To fix this, we need to reshape the input_images tensor to have a shape of [batch_size, image_height, image_width, num_channels]. This can be done by adding the batch_size dimension to the beginning of the shape tuple when reshaping the tensor.
```import tensorflow as tf

# ... (other code remains the same)

reshaped_images = tf.reshape(input_images, [batch_size, image_height, image_width, num_channels])

output_images = tf.image.draw_bounding_boxes(reshaped_images, input_boxes, colors)

```
I am providing [gist](https://colab.sandbox.google.com/gist/Venkat6871/aee2a698128838e2adfbc7dc941cf084/63688_2-15-v.ipynb) here for your reference.

Thank you! Thank you for your response! Doesn't it need functionality like `OP_REQUIRES` which will raise exceptions instead of aborting?  Hi **@vraebfdsb** ,
- As i expected, It will abort. While i will deep dive and confirm with team and let you know more details.

Thank you!
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

binary

### TensorFlow version

tf 2.15

### Custom code

Yes

### OS platform and distribution

Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.9

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Under specific input, `tf.image.draw_bounding_boxes` encounters "Aborted (core dumped)".

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import numpy as np

batch_size = 1
image_height = 100
image_width = 100
num_channels = 3
num_boxes = 2

images = np.random.rand(batch_size, image_height, image_width, num_channels)
boxes = np.random.rand(batch_size, num_boxes, 4)
colors = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])  # Define colors for the bounding boxes

input_images = tf.convert_to_tensor(images, dtype=tf.float32)
input_boxes = tf.convert_to_tensor(boxes, dtype=tf.float32)
input_colors = tf.convert_to_tensor(colors, dtype=tf.float32)

reshaped_images = tf.reshape(input_images, [image_height, image_width, num_channels])

output_images = tf.image.draw_bounding_boxes(reshaped_images, input_boxes, colors)
```


### Relevant log output

```shell
2024-03-14 05:38:04.463737: F tensorflow/core/framework/tensor_shape.cc:357] Check failed: d < dims() (3 vs. 3)
Aborted (core dumped)
```
