learn.Predict with is_test=True throws an error

I am getting the following error when I try to run the predict with istest=True.

I verified the Test folder and it contains images. .

They were not loaded into your data object. This question was already answered on the forum.

That means it didn’t find your test folder, or you didn’t tell it where it is…

I have the following folder structure

I can see all the folders . Is there way to provide the Test Folders

You need to specify your test directory when creating data, like so:

data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz), test_name='test')

predict(which internally calls predict_with_targs) will then use the correct test dataloader so to speak: self.data.test_dl.

Yes, you pass test_name='test' (in your case) when you construct your data object.

I did the same and again getting the same error .

I am using crestle . not sure if I have to delete Temp folder and try

@jeremy can you please help me here. I am kinda of struck

Can you try to delete tmp/ folder, restart your notebook and try all the steps once again?

Are you sure you’re using the newer version of the course? Your top level directory is fastai/courses/dl1, which looks like last year’s version of the course.

No @anurag . I have downloaded it from github repo.

Did you delete the tmp directory?

Also make sure you are using the most recent version so do a git pull

Getting an error while executing these two lines , I delete the /data/dogscats/tmp , git pull and retried .

Can someone tell why this error is coming and what is the fix ? attached the PNG of my worksheet

data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz), test_name=‘test1’)
log_testpreds = learn.predict(is_test=True)

got the issue in my code :slight_smile: missing the two lines
data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz), test_name=‘test1’)
learn = ConvLearner.pretrained(arch, data, precompute=True)
learn.fit(1e-2, 3)
log_testpreds = learn.predict(is_test=True)