admin管理员组

文章数量:1287598

I was trying to load the dataset from tensorflow datasets without having it to download locally and process it to a pipeline in batches so i can feed it into my model. I'm not sure if I'm doing it correct, if it is not the correct approach to do so please mention one.

import tensorflow as tf
import tensorflow_datasets as tfds

# tf.__version__
# '2.18.0'

(train_data, test_data), info= tfds.load('open_images_v4', 
                                 split=['train','test'], 
                                 download=False, 
                                 try_gcs=True,
                                 as_supervised=True, 
                                 shuffle_files=True,
                                 with_info = True,
                                 )

I tried using tensorflow_datasets.load() to load the dataset but it throws assertion errors as:

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-9-5483ac7d6ce0> in <cell line: 0>()
----> 1 (train_data, test_data), info= tfds.load('open_images_v4', 
      2                          split=['train','test'],
      3                          download=False,
      4                          try_gcs=True,
      5                          as_supervised=True,

3 frames
/usr/local/lib/python3.11/dist-packages/tensorflow_datasets/core/dataset_builder.py in as_dataset(self, split, batch_size, shuffle_files, decoders, read_config, as_supervised)
   1002     # pylint: enable=line-too-long
   1003     if not self.data_path.exists():
-> 1004       raise AssertionError(
   1005           "Dataset %s: could not find data in %s. Please make sure to call "
   1006           "dataset_builder.download_and_prepare(), or pass download=True to "

AssertionError: Dataset open_images_v4: could not find data in /root/tensorflow_datasets. Please make sure to call dataset_builder.download_and_prepare(), or pass download=True to tfds.load() before trying to access the tf.data.Dataset object.

本文标签: