Error loading images with data_loader

I’m getting different results when I collect outputs from a model using databunch than I am with data_loader.

The data_loader results are wrong, it’s classifying most of the images as index 3 (no_burn label) even though I didn’t include any no_burn images in the bunch. What’s weird is that the issue only seems to be with this particular model. I’ve tried the same comparison with other models and both methods of loading the images seem to work fine.
Any suggestions for this issue will be greatly appreciated!

Your data isn’t normalized when you use train_dl.dl (the inner PyTorch dataloader), as the normalization happens in train_dl.
That’s probably part of the reason.