protobuf fatal error in Tensorflow 2.16.1 on macos M1
@asapsmc,
Thank you for the issue. Could you please provide the steps you have followed to install the tensorflow 2.16.1 on macos and allow some time to debug the issue. Thank you! I'm using miniforge, so it was `conda install -c apple tensorflow-deps`, then activate and then `python -m pip install tensorflow`followed by `python -m pip install tensorflow-metal`. Hi,
I understand that you are using GPU to build your model. This is an issue with the `tensorflow-metal` library, as it only supports `tensorflow` up to version 2.14. Therefore, it seems that we need to wait for a new version of the `tensorflow-metal` library. For now, if you want to use `tensorFlow` >2.14, you will need to uninstall` tensorflow-metal` or refrain from using the GPU. Thanks for your help. Now I define tensorflow==2.14 and everything works.  @asapsmc,
AFAIK the version of tensorflow-metal==1.1.0 must be along with tensorflow-macos==2.14.0. So, If you use "pip install tensorflow-macos" alone. You will get 2.15.0 or the latest. So you must install the version which tensorflow-metal is supported. Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/64507">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/64507">No</a>

### Issue type

Bug

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

No

### Source

source

### TensorFlow version

2.16.1

### Custom code

No

### OS platform and distribution

macOS Sonoma 14.4

### Mobile device

_No response_

### Python version

3.10.14

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I'm trying to run a test snippet, and I get protobuf FATAL error `[libprotobuf FATAL google/protobuf/message_lite.cc:353] CHECK failed: target + size == res: 
libc++abi: terminating due to uncaught exception of type google::protobuf::FatalException: CHECK failed: target + size == res: `

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import tensorflow_datasets as tfds

print("TensorFlow version:", tf.__version__)
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
tf.config.list_physical_devices('GPU')
(ds_train, ds_test), ds_info = tfds.load(
    'mnist',
    split=['train', 'test'],
    shuffle_files=True,
    as_supervised=True,
    with_info=True,
)


def normalize_img(image, label):
    """Normalizes images: `uint8` -> `float32`."""
    return tf.cast(image, tf.float32) / 255., label


batch_size = 128
ds_train = ds_train.map(
    normalize_img, num_parallel_calls=tf.data.experimental.AUTOTUNE)
ds_train = ds_train.cache()
ds_train = ds_train.shuffle(ds_info.splits['train'].num_examples)
ds_train = ds_train.batch(batch_size)
ds_train = ds_train.prefetch(tf.data.experimental.AUTOTUNE)
ds_test = ds_test.map(
    normalize_img, num_parallel_calls=tf.data.experimental.AUTOTUNE)
ds_test = ds_test.batch(batch_size)
ds_test = ds_test.cache()
ds_test = ds_test.prefetch(tf.data.experimental.AUTOTUNE)
model = tf.keras.models.Sequential([
    tf.keras.layers.Conv2D(32, kernel_size=(3, 3),
                           activation='relu'),
    tf.keras.layers.Conv2D(64, kernel_size=(3, 3),
                           activation='relu'),
    tf.keras.layers.MaxPooling2D(pool_size=(2, 2)),
    #   tf.keras.layers.Dropout(0.25),
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(128, activation='relu'),
    #   tf.keras.layers.Dropout(0.5),
    tf.keras.layers.Dense(10, activation='softmax')
])
model.compile(
    loss='sparse_categorical_crossentropy',
    optimizer=tf.keras.optimizers.Adam(0.001),
    metrics=['accuracy'],
)
model.fit(
    ds_train,
    epochs=12,
    validation_data=ds_test,
)
```


### Relevant log output

```shell
TensorFlow version: 2.16.1
Num GPUs Available:  1
2024-03-26 12:50:25.667311: I metal_plugin/src/device/metal_device.cc:1154] Metal device set to: Apple M1
2024-03-26 12:50:25.667392: I metal_plugin/src/device/metal_device.cc:296] systemMemory: 16.00 GB
2024-03-26 12:50:25.667406: I metal_plugin/src/device/metal_device.cc:313] maxCacheSize: 5.33 GB
2024-03-26 12:50:25.667714: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:305] Could not identify NUMA node of platform GPU ID 0, defaulting to 0. Your kernel may not have been built with NUMA support.
2024-03-26 12:50:25.667759: I tensorflow/core/common_runtime/pluggable_device/pluggable_device_factory.cc:271] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 0 MB memory) -> physical PluggableDevice (device: 0, name: METAL, pci bus id: <undefined>)
Epoch 1/12
2024-03-26 12:50:27.299359: I tensorflow/core/grappler/optimizers/custom_graph_optimizer_registry.cc:117] Plugin optimizer for device_type GPU is enabled.
[libprotobuf FATAL google/protobuf/message_lite.cc:353] CHECK failed: target + size == res: 
libc++abi: terminating due to uncaught exception of type google::protobuf::FatalException: CHECK failed: target + size == res:
```
