0

I am trying to train my deep network on the MNIST dataset. When I try to upload the dataset to the dataloader and get the batched data through the iterator, I get modified data that differs from the original (I attached two images). At the same time, my model learns well from them: the error drops, and the accuracy metric grows, which is why I conclude that everything should work like this. Maybe there is a function that the dataloader applies to my data, but I don't know about it?

You can view the notebook with the code and my problem here.

I have checked two versions of pytorch and two different datasets, but the problem persists everywhere.

4
  • 1
    Could you please share minimal reproducible example? Thx Commented Sep 1, 2024 at 19:08
  • @JohnnyCheesecutter I edited the question and added a link to the ipynb notebook. Commented Sep 2, 2024 at 5:55
  • The dataloader iterator produces a batch of images. Make sure you are plotting individual images and not the whole batch with plt.imshow(). Commented Sep 2, 2024 at 5:57
  • @berinaniesh thanks for the help, but I'm only taking the first image from the batch, not the whole batch Commented Sep 2, 2024 at 6:02

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.