TypeError using dataloaders

I am trying to do multilabel classification on a chest xray dataset by following a tutorial on DataBlock: https://docs.fast.ai/tutorial.datablock.html#Pascal-(multi-label)

This is the dataframe containing the filenames and labels:

This is the DataBlock, where I use the first column ‘Image Index’ for get_x and a custom function for get_y to split the second column ‘Finding Labels’.

However, I’m getting the ff. error on the xray.dataloaders(labels_sample) line:
TypeError: expected str, bytes or os.PathLike object, not DataFrame

What am I doing wrong, and how can I fix this error?

From the linked resource

Notice how there is one more question compared to before: we wont have to use a get_items function here because we already have all our data in one place. But we will need to do something to the raw dataframe to get our inputs, read the first column and add the proper folder before the filename.

get_items may not be needed here.

2 Likes

I can’t believe I missed that part. I was following a different tutorial before that used the ‘get_items’ function, but I forgot to remove it. Thank you so much for your help!