Get_preds() not returning all results

Hi,
I am trying to get the predictions for my TrainSet but fastai keeps returning incorrect no. of predictions.

len(learner_d.data.train_ds)

14986

preds5,_ = learner_d.get_preds(DatasetType.Train)
len(preds5)

14976

Any help would be appreciated. Thank you

You need to use DatasetType.Fix here, which is your training set with the validation transforms and shuffle=False, drop_last=False. Your issue is that since we drop the last incomplete batch (here of size 10) you’re missing 10 predictions. The other issue you don’t see is that your predictions are shuffled and not in the same order as your training set.

Thank you