Datasets: Unable to add Multi-label Datasets

Created on 2 Feb 2021  路  3Comments  路  Source: huggingface/datasets

I am trying to add CIFAR-100 dataset. The dataset contains two labels per image - fine label and coarse label. Using just one label in supervised keys as
supervised_keys=("img", "fine_label") raises no issue. But trying supervised_keys=("img", "fine_label","coarse_label") leads to this error :

Traceback (most recent call last):
  File "test_script.py", line 2, in <module>
    d = load_dataset('./datasets/cifar100')
  File "~/datasets/src/datasets/load.py", line 668, in load_dataset
    **config_kwargs,
  File "~/datasets/src/datasets/builder.py", line 896, in __init__
    super(GeneratorBasedBuilder, self).__init__(*args, **kwargs)
  File "~/datasets/src/datasets/builder.py", line 247, in __init__
    info.update(self._info())
  File "~/.cache/huggingface/modules/datasets_modules/datasets/cifar100/61d2489b2d4a4abc34201432541b7380984ec714e290817d9a1ee318e4b74e0f/cifar100.py", line 79, in _info
    citation=_CITATION,
  File "<string>", line 19, in __init__
  File "~/datasets/src/datasets/info.py", line 136, in __post_init__
    self.supervised_keys = SupervisedKeysData(*self.supervised_keys)
TypeError: __init__() takes from 1 to 3 positional arguments but 4 were given

Is there a way I can fix this?

Also, what does adding supervised_keys do? Is it necessary? How would I specify supervised_keys for a multi-input, multi-label dataset?

Thanks,
Gunjan

Most helpful comment

I can confirm that it comes from TFDS and is not used at the moment.

All 3 comments

Thanks for adding this dataset! As far as I know supervised_keys is mostly a holdover from TFDS, but isn't really used, so feel free to drop it (@lhoestq or @thomwolf correct me if I'm wrong). It definitely shouldn't be blocking :)

I can confirm that it comes from TFDS and is not used at the moment.

Thanks @yjernite @lhoestq

The template for new dataset makes it slightly confusing. I suppose the comment suggesting its update can be removed.

Was this page helpful?
0 / 5 - 0 ratings