Can you include the line of code that the error happens on? It is a bit difficult to see the context without that but one thing I notice is that only the label is used from the dataloader (for y_label in enumerate(dataloader):) whereas it looks like you also want to get the current image from the dataloader.