'Tensorflow: Failed to parse supervisedKeys field: Message type "tensorflow_datasets.SupervisedKeys"

I am required to use python 3.8 and tensorflow 2.7.0 and tensorflow_datasets: 4.4.0 for the Tensorflow certification exam and i am trying to work with mnist dataset using the following code :

import tensorflow_datasets as tfds

# Load dataset
(train_data, test_data), ds_info = tfds.load(name='mnist',  # Dataset name
                                             split=["train", "test"],  # which split is going to be taken
                                             shuffle_files=True,
                                             as_supervised=True,  # get labels of data (feature,label)
                                             with_info=True)  # include dataset meta-data

However, when i run the code, i face with the following error:

google.protobuf.json_format.ParseError: Failed to construct dataset mnist: Failed to parse supervisedKeys field: Message type "tensorflow_datasets.SupervisedKeys" has no field named "tuple".
 Available Fields(except extensions): ['input', 'output'].

What is the reason and how i can fix it ?


Update: When i run it on google-colab it works well, however on my local machine the error happening. I am preparing the configuration of my laptop for the Tensorflow certification exam and that;s why i am requeired to use the following configs and i cannot change it:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source