I’m trying to submit an attempt for the dogs/cats redux. Problem is, my prediction only has 8,819 rows . I’m pretty sure I’ve parsed the data correctly. My redux data directory contains the three sub-folders I created (train,test, and valid) plus the two that were created when I trained my model (models and tmp). Train and valid each have two sub-folders (cats and dogs). The path variable has been set to the following:
PATH = "data/newdogscats/"
The output of os.listdir(PATH) is as follows:
['.ipynb_checkpoints', 'test', 'valid', 'models', 'train', 'tmp']
The image splits (number of image files) for three sub-folders are as follows:
Train: 8,090 (per class)
Valid: 4,410 (per class)
I’ve verified each of these by passing the os.listdir() output to the len() function. Below are the commands I am using to train my model:
data = ImageClassifierData.from_paths(PATH, test_name='test', tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=True)
and yet my learn.predict() method is only creating 8,819 predictions!? Does this have something to do with the discrepancy between the size of the test and train folders, or is there something else I might want to verify? Thanks in advance for your input.
Update: len(data.val_y) only output 8,819. So, I’m thinking it might an issue reading files from the test folder.
Second Update: Solved my own problem It had nothing to do with the commands I pasted. When using learn.predict() you need the is_test = True argument.