Fixing seed to enable reproducibility of snapshot
GreatScherzo opened this issue · 1 comments
GreatScherzo commented
Hi @liznerski,
It seems that when training twice with the same exact training parameters,
the resulting snapshots would differ from one another, resulting in different prediction results.
This may be due to random variables used during training.
Is there a way to set the random seed for training so that the snapshots would be the same?
Thank you for your time!
GreatScherzo commented
Setting the random seed before augmentation seems to work!
Just place the random seed at datasets\image_folder.py
in ADImageFolderDataset
class
as below:
random.seed(1)
torch.manual_seed(1)
np.random.seed(1)