I have been trying to construct a list of pairs of filenames and the corresponding ground truths. Here’s how I tried to do this:
train_preds, train_ground_truths = learn.get_preds(ds_type=DatasetType.Train) train_paths = list(map(lambda path: str(path), learn.data.valid_ds.items)) train_fnames = list(map(lambda path: path.split('/')[:-1], train_paths)) train_fnames_and_ground_truths = list(zip(train_fnames, train_ground_truths))
However, I did a few manual checks and it seems that the two arrays I am zipping together here are completely misaligned… How can I do this?
There’s a similar thread here, Get the filenames of the data in the Test set in the order they're predicted, but there’s no definite, practical answer there either.