Dataset nielsr/funsd can't be loaded

#3
by pierreguillou - opened

Hi @nielsr ,

The following loading code does not work with your dataset (at least, in Colab).
I post as well the error message.

(datasets version: 2.8.0)

Loading code:

!pip install datasets
from datasets import load_dataset

dataset_id ="nielsr/funsd"
dataset = load_dataset(dataset_id)

... and the error message:

Downloading and preparing dataset funsd/funsd to /root/.cache/huggingface/datasets/nielsr___funsd/funsd/1.0.0/8b0472b536a2dcb975d59a4fb9d6fea4e6a1abe260b7fed6f75301e168cbe595...
Generating train split:
0/0 [00:00<?, ? examples/s]
---------------------------------------------------------------------------
UnidentifiedImageError                    Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
   1569                 _time = time.time()
-> 1570                 for key, record in generator:
   1571                     if max_shard_size is not None and writer._num_bytes > max_shard_size:

9 frames
UnidentifiedImageError: cannot identify image file '/root/.cache/huggingface/datasets/downloads/extracted/e5bbbc543f8cc95554da124f3e80a57ed24d67d06ae1467da5810703f851e3f9/dataset/training_data/images/0000971160.png'

The above exception was the direct cause of the following exception:

DatasetGenerationError                    Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
   1604             if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
   1605                 e = e.__context__
-> 1606             raise DatasetGenerationError("An error occurred while generating the dataset") from e
   1607 
   1608         yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)

DatasetGenerationError: An error occurred while generating the dataset

I have same problem, if you find a solution please post here.

Hi @Mustafa-AbdulRazek .

It's very strange because sometimes the code works and sometimes it doesn't.

What I do: I restart my kernel (or my Colab environment) and I restart the code until it works but I have no explanation about what happens.

Sign up or log in to comment