tfds.core.DatasetCollectionLoader
Stay organized with collections
Save and categorize content based on your preferences.
Loader class for dataset collections.
tfds.core.DatasetCollectionLoader(
collection: dataset_collection_builder.DatasetCollection,
requested_version: Optional[str] = None,
loader_kwargs: Optional[Dict[str, Any]] = None
)
Attributes |
collection
|
the DatasetCollection to load.
|
requested_version
|
optional version of the dataset collection to load. If
none given, the latest version will be loaded.
|
loader_kwargs
|
optional kwargs for the tfds.load function.
|
datasets
|
initialized post-init, defines the datasets comprised in the
requested dataset collection.
|
collection_name
|
the name of the DatasetCollection to load.
|
Methods
get_dataset_info
View source
get_dataset_info(
dataset_name: str
)
load_all_datasets
View source
load_all_datasets(
split: Optional[Tree[splits_lib.SplitArg]] = None,
loader_kwargs: Optional[Dict[str, Any]] = None
) -> Mapping[str, Mapping[str, tf.data.Dataset]]
Loads all datasets of a collection.
Args |
split
|
which split(s) of the datasets to load.
|
loader_kwargs
|
dict (optional), keyword arguments to be passed to the
tfds.load function. Refer to tfds.load documentation for a
comperehensive overview of the different loading options.
|
Returns |
dict of dataset_names mapping to a dict of {split_name :
tf.data.Dataset} for each desired datasets.
|
load_dataset
View source
load_dataset(
dataset: str,
split: Optional[Tree[splits_lib.SplitArg]] = None,
loader_kwargs: Optional[Dict[str, Any]] = None
) -> Mapping[str, tf.data.Dataset]
Loads the named dataset from a dataset collection by calling tfds.load
.
Args |
dataset
|
str , the dataset name to load.
|
split
|
which split(s) of the dataset to load. If None , will return all
splits available for the dataset.
|
loader_kwargs
|
dict (optional), keyword arguments to be passed to the
tfds.load function. Refer to tfds.load documentation for a
comperehensive overview of the different loading options.
|
Returns |
A dict of {str : tf.data.Dataset} for the desided dataset.
|
Raises |
KeyError
|
if trying to load a dataset not included in the collection.
|
RuntimeError
|
if load return type is not a dict or a list .
|
load_datasets
View source
load_datasets(
datasets: Iterable[str],
split: Optional[Tree[splits_lib.SplitArg]] = None,
loader_kwargs: Optional[Dict[str, Any]] = None
) -> Mapping[str, Mapping[str, tf.data.Dataset]]
Loads a number of datasets from the dataset collection.
Args |
datasets
|
dataset names to load.
|
split
|
which split(s) of the datasets to load.
|
loader_kwargs
|
keyword arguments to be passed to the tfds.load function.
Refer to tfds.load documentation for a comperehensive overview of the
different loading options.
|
Returns |
mapping between a dataset name and a mapping of split name to
tf.data.Dataset for each requested dataset.
|
Raises |
ValueError
|
if no dataset(s) to load are given.
|
print_datasets
View source
print_datasets() -> None
print_info
View source
print_info() -> None
Prints information about this dataset collection.
set_loader_kwargs
View source
set_loader_kwargs(
loader_kwargs: Dict[str, Any]
)
__eq__
__eq__(
other
)
Class Variables |
loader_kwargs
|
None
|
requested_version
|
None
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tfds.core.DatasetCollectionLoader\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L241-L428) |\n\nLoader class for dataset collections. \n\n tfds.core.DatasetCollectionLoader(\n collection: dataset_collection_builder.DatasetCollection,\n requested_version: Optional[str] = None,\n loader_kwargs: Optional[Dict[str, Any]] = None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|---------------------|-------------------------------------------------------------------------------------------------------|\n| `collection` | the DatasetCollection to load. |\n| `requested_version` | optional version of the dataset collection to load. If none given, the latest version will be loaded. |\n| `loader_kwargs` | optional kwargs for the [`tfds.load`](../../tfds/load) function. |\n| `datasets` | initialized post-init, defines the datasets comprised in the requested dataset collection. |\n| `collection_name` | the name of the DatasetCollection to load. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `get_dataset_info`\n\n[View source](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L281-L290) \n\n get_dataset_info(\n dataset_name: str\n )\n\n### `load_all_datasets`\n\n[View source](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L409-L428) \n\n load_all_datasets(\n split: Optional[Tree[splits_lib.SplitArg]] = None,\n loader_kwargs: Optional[Dict[str, Any]] = None\n ) -\u003e Mapping[str, Mapping[str, tf.data.Dataset]]\n\nLoads all datasets of a collection.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `split` | which split(s) of the datasets to load. |\n| `loader_kwargs` | `dict` (optional), keyword arguments to be passed to the [`tfds.load`](../../tfds/load) function. Refer to [`tfds.load`](../../tfds/load) documentation for a comperehensive overview of the different loading options. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| `dict` of `dataset_names` mapping to a `dict` of {`split_name`: tf.data.Dataset} for each desired datasets. ||\n\n\u003cbr /\u003e\n\n### `load_dataset`\n\n[View source](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L295-L376) \n\n load_dataset(\n dataset: str,\n split: Optional[Tree[splits_lib.SplitArg]] = None,\n loader_kwargs: Optional[Dict[str, Any]] = None\n ) -\u003e Mapping[str, tf.data.Dataset]\n\nLoads the named dataset from a dataset collection by calling [`tfds.load`](../../tfds/load).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dataset` | `str`, the dataset name to load. |\n| `split` | which split(s) of the dataset to load. If `None`, will return all splits available for the dataset. |\n| `loader_kwargs` | `dict` (optional), keyword arguments to be passed to the [`tfds.load`](../../tfds/load) function. Refer to [`tfds.load`](../../tfds/load) documentation for a comperehensive overview of the different loading options. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A `dict` of {`str`: tf.data.Dataset} for the desided dataset. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|----------------|-------------------------------------------------------------|\n| `KeyError` | if trying to load a dataset not included in the collection. |\n| `RuntimeError` | if `load` return type is not a `dict` or a `list`. |\n\n\u003cbr /\u003e\n\n### `load_datasets`\n\n[View source](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L378-L407) \n\n load_datasets(\n datasets: Iterable[str],\n split: Optional[Tree[splits_lib.SplitArg]] = None,\n loader_kwargs: Optional[Dict[str, Any]] = None\n ) -\u003e Mapping[str, Mapping[str, tf.data.Dataset]]\n\nLoads a number of datasets from the dataset collection.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `datasets` | dataset names to load. |\n| `split` | which split(s) of the datasets to load. |\n| `loader_kwargs` | keyword arguments to be passed to the [`tfds.load`](../../tfds/load) function. Refer to [`tfds.load`](../../tfds/load) documentation for a comperehensive overview of the different loading options. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| mapping between a dataset name and a mapping of split name to tf.data.Dataset for each requested dataset. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|--------------|-------------------------------------|\n| `ValueError` | if no dataset(s) to load are given. |\n\n\u003cbr /\u003e\n\n### `print_datasets`\n\n[View source](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L278-L279) \n\n print_datasets() -\u003e None\n\n### `print_info`\n\n[View source](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L266-L276) \n\n print_info() -\u003e None\n\nPrints information about this dataset collection.\n\n### `set_loader_kwargs`\n\n[View source](https://github.com/tensorflow/datasets/blob/v4.9.3/tensorflow_datasets/core/load.py#L292-L293) \n\n set_loader_kwargs(\n loader_kwargs: Dict[str, Any]\n )\n\n### `__eq__`\n\n __eq__(\n other\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Class Variables --------------- ||\n|-------------------|--------|\n| loader_kwargs | `None` |\n| requested_version | `None` |\n\n\u003cbr /\u003e"]]