tensorflow / tensorflow/datasets
Trying to access splits inside the ds-info, which is an empty dict
@tomvdw is already working on this.
Since Mar 23, 2023.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 1.6k
- Avg merge
- 3h 54m
- Merged PRs (30d)
- 1
Description
/!\ PLEASE INCLUDE THE FULL STACKTRACE AND CODE SNIPPET
Short description
Description of the bug.
The Splits dictionary coming as empty when you use the latest version of the tensorflow-datasets =4.8.3 ,but if you use the tensorflow-datasets=4.8.2 version, its working fine.
Environment information
-
Operating System:
-
Python version:
-
tensorflow-datasets/tfds-nightlyversion: -
tensorflow/tf-nightlyversion: -
Does the issue still exists with the last
tfds-nightlypackage (pip install --upgrade tfds-nightly) ?
Reproduction instructions
Use the latest version of the `pip install tensorflow-datasets =4.8.3' ,you will see the error.
tfds_name = 'cifar10'
ds_info = tfds.builder(tfds_name ).info
ds_info.splits['test'].num_examples
Link to logs
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-6-08c8a6b834e3>](https://localhost:8080/#) in <module>
21 exp_config.trainer.checkpoint_interval = train_steps
22 exp_config.trainer.validation_interval = 1000
---> 23 exp_config.trainer.validation_steps = ds_info.splits['test'].num_examples // batch_size
24 exp_config.trainer.train_steps = train_steps
25 exp_config.trainer.optimizer_config.learning_rate.type = 'cosine'
[/usr/local/lib/python3.8/dist-packages/tensorflow_datasets/core/splits.py](https://localhost:8080/#) in __getitem__(self, key)
389 def __getitem__(self, key):
390 if not self:
--> 391 raise KeyError(
392 f'Trying to access `splits[{key!r}]` but `splits` is empty. '
393 'This likely indicate the dataset has not been generated yet.'
KeyError: "Trying to access `splits['test']` but `splits` is empty. This likely indicate the dataset has not been generated yet."
Expected behavior
The Splits dictionary should not come as empty
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.