Issues in loading image from dataset
I am trying to use the code below to load a dataset and display the imagefrom datasets import load_datasetdataset = load_dataset(“darentang/sroie”)from PIL import Image, ImageDraw, ImageFontimage = Image.open(dataset[‘train’][34][‘image_path’])image = image.convert(“RGB”)image.resize((350,450))but when i try to show the image, it says that the file is not foundFileNotFoundError                         Traceback (most recent call last)in <cell line: 3>()1 from PIL import Image, ImageDraw, ImageFont2----> 3 image = Image.open(dataset[‘train’][34][‘image_path’])4 image = image.convert(“RGB”)5 image.resize((350,450))/usr/local/lib/python3.10/dist-packages/PIL/Image.py in open(fp, mode, formats)32253226     if filename:→ 3227         fp = builtins.open(filename, “rb”)3228         exclusive_fp = True3229FileNotFoundError: [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’
2023-12-25T18:16:10Z
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
2024-01-20T03:07:41Z
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
2024-01-22T15:47:14Z
You can find the fix, which doesn’t require downgradingdatasets, inthis Discord thread.