Solved by ptrblck in post #2 
              
              
                I assume you are referring to the image name (or path), not the class name. 
If so, you could create a custom Dataset as described here and return the image name in the __getitem__ additionally to the data and target tensors. Inside the DataLoader loop you would then have 3 values and could print th…