Issues in loading image from dataset

I am trying to use the code below to load a dataset and display the image

from datasets import load_dataset
dataset = load_dataset(“darentang/sroie”)

from PIL import Image, ImageDraw, ImageFont
image =[‘train’][34][‘image_path’])
image = image.convert(“RGB”)

but when i try to show the image, it says that the file is not found

FileNotFoundError Traceback (most recent call last)
in <cell line: 3>()
1 from PIL import Image, ImageDraw, ImageFont
----> 3 image =[‘train’][34][‘image_path’])
4 image = image.convert(“RGB”)
5 image.resize((350,450))

/usr/local/lib/python3.10/dist-packages/PIL/ in open(fp, mode, formats)
3226 if filename:
→ 3227 fp =, “rb”)
3228 exclusive_fp = True

FileNotFoundError: [Errno 2] No such file or directory: ‘/storage/hf-datasets-cache/all/datasets/89901751940830-config-parquet-and-info-darentang-sroie-aacc85f6/downloads/extracted/152a7c8b8e335ea11ab20a6c13040fb29c89ac2aee4c5c09dd36ad4a6fc28fe4/sroie/train/images/X51005433533.jpg’

Suddenly was struck with this two days ago, everything worked before perfectly.
Narrowed down to new version 2.16.0 of datasets, so these two commands helped:

python -m pip uninstall datasets
python -m pip install datasets==2.15

In case, this problem is not fixed yet, you may calculate your own “duration” values of the audiofile. Please see: Huggingface_Audio_Course/Huggingface-Audio_dataset.ipynb at main · kimdesok/Huggingface_Audio_Course · GitHub

You can find the fix, which doesn’t require downgrading datasets, in this Discord thread.