About the problem of random seed affecting the recurrence of results
fanglaosi opened this issue · comments
hi, @ma-xu!
I really appreciate your contribution to this work.
I want to ask about the random seed. When I ran the pointMLP code myself, the results of each run were different at the situation that I fixed the random seed. What is the reason for this?
I'd appreciate it if you returned.
@fanglaosi Thanks for your interest.
We cannot exactly fix the random seed (for all methods), even use the follow codes:
def set_seed(seed=None):
if seed is None:
return
random.seed(seed)
os.environ['PYTHONHASHSEED'] = ("%s" % seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True
One possible reason is the randomness caused by pytorch training dataloader. see here: https://stackoverflow.com/questions/63515991/the-result-is-not-fixed-after-setting-random-seed-in-pytorchhttps://pytorch.org/docs/stable/notes/randomness.html
However, we can reproduce the results using a pretrained model. Let me know if you have any further questions.
Closed since no further discussions. Feel free to reopen it if necessary.