Report

#1
by arpit-gour02 - opened

In the test set the img at 34965 is corrupted

ds["test"][34965]

/Users/arpit-zstch1557/miniconda3/envs/lab_env/lib/python3.12/site-packages/PIL/TiffImagePlugin.py:950: UserWarning: Corrupt EXIF data. Expecting to read 2 bytes but only got 0.
warnings.warn(str(msg))

UnidentifiedImageError Traceback (most recent call last)
Cell In[7], line 1
----> 1 ds["test"][34965]

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/arrow_dataset.py:2876, in Dataset.getitem(self, key)
2874 if self._format_type is None or self._format_type not in ("arrow", "pandas", "polars"):
2875 return Column(self, key)
-> 2876 return self._getitem(key)

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/arrow_dataset.py:2858, in Dataset._getitem(self, key, **kwargs)
2856 formatter = get_formatter(format_type, features=self._info.features, **format_kwargs)
2857 pa_subtable = query_table(self._data, key, indices=self._indices)
-> 2858 formatted_output = format_table(
2859 pa_subtable, key, formatter=formatter, format_columns=format_columns, output_all_columns=output_all_columns
2860 )
2861 return formatted_output

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/formatting/formatting.py:658, in format_table(table, key, formatter, format_columns, output_all_columns)
656 python_formatter = PythonFormatter(features=formatter.features)
657 if format_columns is None:
--> 658 return formatter(pa_table, query_type=query_type)
659 elif query_type == "column":
660 if key in format_columns:

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/formatting/formatting.py:411, in Formatter.call(self, pa_table, query_type)
409 def call(self, pa_table: pa.Table, query_type: str) -> Union[RowFormat, ColumnFormat, BatchFormat]:
410 if query_type == "row":
--> 411 return self.format_row(pa_table)
412 elif query_type == "column":
413 return self.format_column(pa_table)

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/formatting/formatting.py:460, in PythonFormatter.format_row(self, pa_table)
458 return LazyRow(pa_table, self)
459 row = self.python_arrow_extractor().extract_row(pa_table)
--> 460 row = self.python_features_decoder.decode_row(row)
461 return row

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/formatting/formatting.py:224, in PythonFeaturesDecoder.decode_row(self, row)
223 def decode_row(self, row: dict) -> dict:
--> 224 return self.features.decode_example(row, token_per_repo_id=self.token_per_repo_id) if self.features else row

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/features/features.py:2106, in Features.decode_example(self, example, token_per_repo_id)
2091 def decode_example(self, example: dict, token_per_repo_id: Optional[dict[str, Union[str, bool, None]]] = None):
2092 """Decode example with custom feature decoding.
2093
2094 Args:
(...) 2102 dict[str, Any]
2103 """
2105 return {
-> 2106 column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
2107 if self._column_requires_decoding[column_name]
2108 else value
2109 for column_name, (feature, value) in zip_dict(
2110 {key: value for key, value in self.items() if key in example}, example
2111 )
2112 }

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/features/features.py:1414, in decode_nested_example(schema, obj, token_per_repo_id)
1411 # Object with special decoding:
1412 elif hasattr(schema, "decode_example") and getattr(schema, "decode", True):
1413 # we pass the token to read and decode files from private repositories in streaming mode
-> 1414 return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) if obj is not None else None
1415 return obj

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/datasets/features/image.py:192, in Image.decode_example(self, value, token_per_repo_id)
190 image = PIL.Image.open(bytes_)
191 else:
--> 192 image = PIL.Image.open(BytesIO(bytes_))
193 image.load() # to avoid "Too many open files" errors
194 if image.getexif().get(PIL.Image.ExifTags.Base.Orientation) is not None:

File ~/miniconda3/envs/lab_env/lib/python3.12/site-packages/PIL/Image.py:3580, in open(fp, mode, formats)
3578 warnings.warn(message)
3579 msg = "cannot identify image file %r" % (filename if filename else fp)
-> 3580 raise UnidentifiedImageError(msg)

UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x1023e7f10>

Sign up or log in to comment