cszn / DnCNN

Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising (TIP, 2017)
https://cszn.github.io/
1.47k stars 539 forks source link

Repetitive Dataset and DataLoader Creation in PyTorch version #96

Open sptom opened 2 years ago

sptom commented 2 years ago

Hi there! My question is - is there any particular reason for creating the entire dataset and dataloader every epoch from scratch? This is done in the PyTorch version, in the main_train file:

image

As I see it - it doesn't add anything because the addition of the noise is done in the 'get_item' function, so the noise is randomized any way a batch is drawn anyway. So this creation takes time from computing the same dataloader each epoch, without adding value.

Am I missing something? Please correct me if I'm wrong