TypeError: 'PILImage' object is not subscriptable

Hi! I’m a beginner here. I was trying to run the following code but got this error while running data block summary:

My dataset looks something like this:

Any help is appreciated!
Thank you

The only difference I found to Data Block tutorial is that you use the df["col"] way instead of df.col. So maybe you can try to use r.img_path and so on

pascal = DataBlock(blocks=(ImageBlock, MultiCategoryBlock),
get_x=lambda o:f’{pascal_source}/train/’+o.fname,
get_y=lambda o:o.labels.split(),

dls = pascal.dataloaders(df)