What and how does show_batch actually do?

Hi I am trying to figure out a problem with my notebooks right now with show_batch(), namely in 01_intro and 02_production. The learn.show_results() in 01_intro and dls.valid.show_batch() functions in 02_production return None and does not show any images of the input data, despite having datasets. I verified that dls does have images of the valid dataset by outputting an image through dls.valid_ds. So somehow the dataloader correctly loads the images but when running the show_batch function, the function returns None.

I am trying to pinpoint where the problem is but I don’t exactly understand how show_batch accesses the data in the dataloader to prepare its batch. If someone can help, I hope to solve why I get ‘None’ returned even when there is data in the dataloader.

This is a high level answer - but essentially show_batch goes through all the transforms you’ve provided explicitly or via the DataBlock, and then keeps reversing through them until it finds a Transform that has a decode method that returns an object that can show itself. Typically the show method will return a matplotlib object that can be displayed. Sorry it’s not more detailed, but you can dig in deeper here.