How to feed testing data to the learner?

Hi,

I am building an image classifier for a dataset where data is divided into two folder one with labeled training data and another with unlabeled testing data. I couldn’t find any information on how to feed this testing data to my learner and make predictions with it. Should I feed the testing data to the dataloader or give it later on to the learner? How do I get the predictions for my testing data? Help appreciated!

Thanks

SOLUTION:

  1. test_items = get_image_files(test_folder_path)
  2. test_dl = dls.test_dl(test_items)
  3. preds,_ = learn.get_preds(dl=test_dl)

You can create test dataloader using
test_dl = dls.test_dl(your_test_items) (where dls is your main dataloaders object
and get predictions by learn.get_preds(dl=test_dl)

1 Like

Okey I got it.

  1. test_items = get_image_files(test_folder_path)
  2. test_dl = dls.test_dl(test_items)
  3. preds,_ = learn.get_preds(dl=test_dl)