Dataset nielsr/funsd-layoutlmv3 can't be loaded

#4
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-layoutlmv3"
dataset = load_dataset(dataset_id)

... and the error message:

Downloading and preparing dataset funsd-layoutlmv3/funsd to /root/.cache/huggingface/datasets/nielsr___funsd-layoutlmv3/funsd/1.0.0/0e3f4efdfd59aa1c3b4952c517894f7b1fc4d75c12ef01bcc8626a69e41c1bb9...
---------------------------------------------------------------------------
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

Can you check it on your side? Thank you.

I run normally in my computer, (datasets version: 2.6.0),this is a NER task dataset

my code is :

from datasets import load_dataset
dataset_id ="nielsr/funsd-layoutlmv3"
dataset = load_dataset(dataset_id)
data = dataset.data
data['train'].to_pandas().to_excel('train.xlsx')
data['test'].to_pandas().to_excel('test.xlsx')

Sign up or log in to comment