Test dataloader(md.test_dl) filenames

I am using notebook 8 and 9 for Kaggle RSNA competition.
Since, output is bounding boxes with variable lengths, I could not use

preds = learn.predict(is_test=True)

So I used following code for obtaining test predictions

dl = md.test_dl
for *x,y in iter(dl):
    batch =learn.model(*VV(x))
    b_clas,b_bb = batch

I could all predictions for test dataset.

However, I am not sure in which order test dataloader loaded files. Thus, I was not sure about one-to-one relation between files in test dataset and obtained predictions.

Is there any way of fetching filenames for each batch of files from md.test_dl?

Appreciate suggestions.

You should be able to access the filenames with something like md.test_ds.fnames to get a list of filenames. They key difference being using the dataset instead of the dataloader.

If I remember correctly, test dataloaders don’t shuffle by default so the order of files in md.test_ds.fnames should match the order of images loaded from the dataloader, but double check to make sure.

Thanks Karl!!