[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get KeyError while loading celeb_a dataset with tfds(tensorflow_datasets) #2801

Closed
ryoma310 opened this issue Nov 30, 2020 · 1 comment
Closed
Labels

Comments

@ryoma310
Copy link

try to load celeb_a dataset with tfds(my code below)

import tensorflow_datasets as tfds
tfds.load('celeb_a')

output

KeyError                                  Traceback (most recent call last)
<ipython-input-22-c041a8b6c170> in <module>
      4 # datasets = builder.as_dataset()
      5 
----> 6 tfds.load('celeb_a', split=tfds.Split.TRAIN)
      7 # tfds.load('celeb_a', split="train")

~/labo/generative_deep_learning/.venv/lib/python3.8/site-packages/tensorflow_datasets/core/load.py in load(name, split, data_dir, batch_size, shuffle_files, download, as_supervised, decoders, read_config, with_info, builder_kwargs, download_and_prepare_kwargs, as_dataset_kwargs, try_gcs)
    342   if download:
    343     download_and_prepare_kwargs = download_and_prepare_kwargs or {}
--> 344     dbuilder.download_and_prepare(**download_and_prepare_kwargs)
    345 
    346   if as_dataset_kwargs is None:

~/labo/generative_deep_learning/.venv/lib/python3.8/site-packages/tensorflow_datasets/core/dataset_builder.py in download_and_prepare(self, download_dir, download_config)
    416           # Old version of TF are not os.PathLike compatible
    417           with tf_compat.mock_gfile_pathlike():
--> 418             self._download_and_prepare(
    419                 dl_manager=dl_manager,
    420                 download_config=download_config,

~/labo/generative_deep_learning/.venv/lib/python3.8/site-packages/tensorflow_datasets/core/dataset_builder.py in _download_and_prepare(self, dl_manager, download_config)
   1093       else:
   1094         optional_pipeline_kwargs = {}
-> 1095       split_generators = self._split_generators(  # pylint: disable=unexpected-keyword-arg
   1096           dl_manager, **optional_pipeline_kwargs
   1097       )

~/labo/generative_deep_learning/.venv/lib/python3.8/site-packages/tensorflow_datasets/image/celeba.py in _split_generators(self, dl_manager)
    137     all_images = {
    138         os.path.split(k)[-1]: img for k, img in
--> 139         dl_manager.iter_archive(downloaded_dirs["img_align_celeba"])
    140     }
    141 

~/labo/generative_deep_learning/.venv/lib/python3.8/site-packages/tensorflow_datasets/core/download/download_manager.py in iter_archive(self, resource)
    663     if isinstance(resource, type_utils.PathLikeCls):
    664       resource = resource_lib.Resource(path=resource)
--> 665     return extractor.iter_archive(resource.path, resource.extract_method)
    666 
    667   @typing.overload

~/labo/generative_deep_learning/.venv/lib/python3.8/site-packages/tensorflow_datasets/core/download/extractor.py in iter_archive(path, method)
    224     An iterator of `(path_in_archive, f_obj)`
    225   """
--> 226   return _EXTRACT_METHODS[method](path)

KeyError: <ExtractMethod.NO_EXTRACT: 1>

Environment information

  • OS: ubuntu 20.04 LTS
  • Python version: 3.8.5 with pipenv
  • tensorflow-datasets version: 4.1.0
  • tensorflow version: 2.3.1
@ryoma310 ryoma310 added the help label Nov 30, 2020
@Conchylicultor
Copy link
Member

I'm gonna mark this as duplicate of #1482 or #2321.

I would suggest you to try: https://www.tensorflow.org/datasets/overview#manual_download_if_download_fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants