Tensorflow Load Datasets Failure for Python 3.11.4 and Tensorflow 2.13.0
Appears to be fixed in nightly  2.14.0-dev20230721 Hi @teddy661 ,

I have replicated the reported behaviour with TF2.13 and python=3.11 and the reported error was observed. However with tf-nightly there is no such error which also same as per your observation. Attached below are the logs for checking same.

[61351-logs.txt](https://github.com/tensorflow/tensorflow/files/12142597/61351-logs.txt)


It's already resolved in tf-nightly. We need to check whether the error is actually stopping from loading dataset. Could you please check whether the dataset actually loaded or not ? You can use the below code for checking.

`ds_train.take(1).get_single_element()
` It does appear to load the dataset and return the first element correctly. I'll try to run a model fit with it later to see if I'm getting the same results. I didn't want to move forward with it since I wasn't sure what exactly was going on with the entirety of the data. 

In [2]: ds_train.take(1).get_single_element()
Out[2]:
({'attention_mask': <tf.Tensor: shape=(386,), dtype=int32, numpy=
  array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int32)>,
  'input_ids': <tf.Tensor: shape=(386,), dtype=int32, numpy=
  array([  101,  2043,  2106, 20773,  2707,  3352,  2759,  1029,   102,
         20773, 21025, 19358, 22815,  1011,  5708,  1006,  1013, 12170,
         23432, 29715,  3501, 29678, 12325, 29685,  1013, 10506,  1011,
         10930,  2078,  1011,  2360,  1007,  1006,  2141,  2244,  1018,
          1010,  3261,  1007,  2003,  2019,  2137,  3220,  1010,  6009,
          1010,  2501,  3135,  1998,  3883,  1012,  2141,  1998,  2992,
          1999,  5395,  1010,  3146,  1010,  2016,  2864,  1999,  2536,
          4823,  1998,  5613,  6479,  2004,  1037,  2775,  1010,  1998,
          3123,  2000,  4476,  1999,  1996,  2397,  4134,  2004,  2599,
          3220,  1997,  1054,  1004,  1038,  2611,  1011,  2177, 10461,
          1005,  1055,  2775,  1012,  3266,  2011,  2014,  2269,  1010,
         25436, 22815,  1010,  1996,  2177,  2150,  2028,  1997,  1996,
          2088,  1005,  1055,  2190,  1011,  4855,  2611,  2967,  1997,
          2035,  2051,  1012,  2037, 14221,  2387,  1996,  2713,  1997,
         20773,  1005,  1055,  2834,  2201,  1010, 20754,  1999,  2293,
          1006,  2494,  1007,  1010,  2029,  2511,  2014,  2004,  1037,
          3948,  3063,  4969,  1010,  3687,  2274,  8922,  2982,  1998,
          2956,  1996,  4908,  2980,  2531,  2193,  1011,  2028,  3895,
          1000,  4689,  1999,  2293,  1000,  1998,  1000,  3336,  2879,
          1000,  1012,   102,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0,     0,
             0,     0,     0,     0,     0,     0,     0,     0],
        dtype=int32)>,
  'qas_id': <tf.Tensor: shape=(), dtype=string, numpy=b'56be85543aeaaa14008c9063'>,
  'feature_index': <tf.Tensor: shape=(), dtype=int64, numpy=0>,
  'token_type_ids': <tf.Tensor: shape=(386,), dtype=int32, numpy=
  array([0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int32)>},
 {'end_positions': <tf.Tensor: shape=(), dtype=int64, numpy=78>,
  'cls_index': <tf.Tensor: shape=(), dtype=int64, numpy=0>,
  'is_impossible': <tf.Tensor: shape=(), dtype=int32, numpy=0>,
  'start_positions': <tf.Tensor: shape=(), dtype=int64, numpy=75>,
  'p_mask': <tf.Tensor: shape=(386,), dtype=int32, numpy=
  array([0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
         1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], dtype=int32)>})
 Hi @teddy661 ,

For me it seems issue with TF2.13 which eventually resolved in tf-nightly.

I have added `ds_train.take(1).get_single_element()` at last just to ensure dataset loaded. Because we are able to extract first element which indicates dataset is loaded indeed which addresses this issue.

Please check the training with tf-nightly and let us know if still have problem. If not please feel free to close the issue if resolved.

Thanks! Looks ok in tf-nightly 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/61351">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/61351">No</a>
 Hi, I am unable to install tensorflow nightly. Any suggestions ?

I am running tensor flow 2.13.1 ?
### Issue type

Bug

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

Yes

### Source

binary

### TensorFlow version

2.13.0

### Custom code

No

### OS platform and distribution

Rocky Linux 8.7

### Mobile device

_No response_

### Python version

3.11.4

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

11.8/8.9.0.131-1

### GPU model and memory

_No response_

### Current behavior?

Dataset written and loaded in python 3.11.4 and tensorflow 2.12.1 should load in tensorflow 2.13

However, loading dataset in Tensorflow 2.13 with python 3.11.4 fails on Linux and windows: 

TensorFlow version: 2.13.0
Python version: 3.11.4
Download dev dataset...
Extract dev dataset...

Loading dev dataset...
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/text_format.cc:337] Error parsing text-format tensorflow.data.experimental.DistributedSnapshotMetadata: 1:1: Invalid control characters encountered in text.
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/text_format.cc:337] Error parsing text-format tensorflow.data.experimental.DistributedSnapshotMetadata: 1:3: Expected identifier, got: 14022746025082002701
Download train dataset...
Extract train dataset...

Loading train dataset...
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/text_format.cc:337] Error parsing text-format tensorflow.data.experimental.DistributedSnapshotMetadata: 1:1: Invalid control characters encountered in text.
[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/text_format.cc:337] Error parsing text-format tensorflow.data.experimental.DistributedSnapshotMetadata: 1:3: Expected identifier, got: 10775564831112808841

### Standalone code to reproduce the issue

```shell
import io
import sys
from zipfile import ZipFile

import requests
import tensorflow as tf

print("TensorFlow version:", tf.__version__)
print("Python version:", sys.version.split()[0])

dev_url = (
    "https://drive.google.com/uc?export=download&id=1-MJAgrTNZkaMpyBQLIgqqwM8gP9LKdDL"
)

print("Download dev dataset...")
r = requests.get(dev_url)
z = ZipFile(io.BytesIO(r.content))
print("Extract dev dataset...")
z.extractall()
print("\nLoading dev dataset...")
ds_dev = tf.data.Dataset.load("squadv2_dev_tf")

train_url = (
    "https://drive.google.com/uc?export=download&id=1-NWGcJz0ZaFGFeHOPG2PKvn8gmf3MwKn"
)
print("Download train dataset...")
r = requests.get(train_url)
z = ZipFile(io.BytesIO(r.content))
print("Extract train dataset...")
z.extractall()
print("\nLoading train dataset...")
ds_train = tf.data.Dataset.load("squadv2_train_tf")
```


### Relevant log output

_No response_