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

Fail to load dataset for train.bat script. #70

Open
cloudy-sfu opened this issue Apr 11, 2024 · 2 comments
Open

Fail to load dataset for train.bat script. #70

cloudy-sfu opened this issue Apr 11, 2024 · 2 comments

Comments

@cloudy-sfu
Copy link

When run bash train.sh, the following error occurs. How to solve it?

  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/load.py", line 643, in load
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/logging/__init__.py", line 168, in __call__
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/load.py", line 643, in load
    dbuilder = _fetch_builder(
               ^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/load.py", line 498, in _fetch_builder
    return builder(name, data_dir=data_dir, try_gcs=try_gcs, **builder_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/logging/__init__.py", line 168, in __call__
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/load.py", line 225, in builder
    raise not_found_error
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/load.py", line 202, in builder
    cls = builder_cls(str(name))
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/load.py", line 124, in builder_cls
    cls = registered.imported_builder_cls(str(ds_name))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cld/.conda/envs/ml-tf/lib/python3.11/site-packages/tensorflow_datasets/core/registered.py", line 296, in imported_builder_cls
    raise DatasetNotFoundError(f'Dataset {name} not found.')
tensorflow_datasets.core.registered.DatasetNotFoundError: Dataset image_label_folder not found.
@captain-pool
Copy link
Owner

Hi @cloudy-sfu , this apparently is because of a breaking change in TensorFlow 2 API.
Please try replacing the image_label_folder loader in the train.sh file with: https://www.tensorflow.org/datasets/api_docs/python/tfds/folder_dataset/ImageFolder

@cloudy-sfu
Copy link
Author

Thanks, now the scrip can run, I replace the variable CODE with

CODE="import os;
  import tensorflow_datasets as tfds;
  dl_config = tfds.download.DownloadConfig(manual_dir=os.path.expanduser('$DATADIR'));
  ds = tfds.load(name='image_label_folder',
    data_dir=os.path.expanduser('$DATADIR'),
    split='train',
    as_supervised=True,
    download_and_prepare_kwargs={'download_config': dl_config});"

But, the folder datadir/coco2014/train/none is still empty. Taking coco2014 which is used in train.sh as an example, which value should I change image_label_folder to?

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

No branches or pull requests

2 participants