VQGAN-CLIP
VQGAN-CLIP copied to clipboard
setting seed doesn't guarantee reprudicibility
Looks like setting the seed doesn't truly produce the same results. After some testing I noticed that these lines
torch.manual_seed(seed)
torch.backends.cudnn.benchmark = False
should be improved by adding the following statements
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.random.seed(seed)
random.seed(seed)
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True
If this is not the case then I may have modified some files when checking out this project and removed determinism
these lines, are they in the generate.py?
i have found the same but cannot find where to add your code in
@FaradaysInfinity you can add the seed-related lines here, and the cudnn-related lines here. I rewritten most of this project from scratch, so I have everything in the same place but it shouldn't matter
hi, did you find any other parameters needed to assure reproducibility? I have implemented the lines your mention, and I get very close results, but not exactly the same.
The weird thing is that even after searching online I couldn't figure out what other randomness source could be at play here