admin管理员组

文章数量:1122832

I have a custom dataset (images of pizza,sushi and steak). I'm using torch DataLoader for it , now when writing the test dataloader custom should we set shuffle=true or it just doesn't matter??

I haven't seen difference yet , but just asking the general.

I have a custom dataset (images of pizza,sushi and steak). I'm using torch DataLoader for it , now when writing the test dataloader custom should we set shuffle=true or it just doesn't matter??

I haven't seen difference yet , but just asking the general.

Share Improve this question edited Nov 21, 2024 at 21:16 Christoph Rackwitz 15.1k5 gold badges38 silver badges49 bronze badges asked Nov 21, 2024 at 19:33 YoussefYoussef2121YoussefYoussef2121 1
Add a comment  | 

1 Answer 1

Reset to default 0

If you use shuffle=True it should reshuffle the data at each epoch (from PyTorch documentation). This means that at each epoch, the batches of data will be arranged differently with respect to the previous one.

During testing, since during testing the model doesn't change and you don't usually test for multiple epochs, it shouldn't make any difference.

However, setting shuffle=False, ensures consistency in the order of predictions, and it may make debugging easier.

本文标签: