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 = 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 found
FileNotFoundError Traceback (most recent call last)
in <cell line: 3>()
1 from PIL import Image, ImageDraw, ImageFont
2
----> 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)
3225
3226 if filename:
→ 3227 fp = builtins.open(filename, “rb”)
3228 exclusive_fp = True
3229
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’