I want to ask if there exists a method that can help me transform a tf.data.dataset to a datasets.dataset.
Hi! We don’t have a dedicated method for converting
datasets.Dataset, only the other way around.
So you have two options:
- If the dataset is small and fits in RAM, you can convert the TF dataset to a Python dictionary and then call
datasets.Dataset.from_dicton it. Another approach that might be easier is to install Tensorflow Datasets and convert the TF dataset to a Pandas DataFrame, on which you can call
- If the dataset doesn’t fit in RAM, you can create a simple loading script in which you iterate over the dataset and yield its examples in
_generate_examples. You can find more info here: Create a dataset loading script.