The question of fix_random_seed
See original GitHub issuehi, recently I want to reproduce the provided result of usr’s, the usr’s result is obtained by training 20 epochs with pv_rcnn. When I trained 20 epochs and then tested the result, which is not inconsistent with usr’s. I think the reason the that not set fix_random_seed=True , so the usr re-train the model with fix_random_seed=True and get the new result. But the result is also inconsistent with my re-trained results by setting fix_random_seed=True. Then I check the source code of common_utils.set_random_seed, I found that it did not set torch.cuda.manual_seed(seed).
def set_random_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
According to pytorch official, it may be need to set torch.cuda.manual_seed(seed). could you please help me analyze that this is the reason to cause the inconsistent result? Thank you very much!!
Issue Analytics
- State:
- Created 3 years ago
- Comments:8

Top Related StackOverflow Question
@wuyujiji I think “needs discussion” means this problem needs more discussions from more users who have some experiences about it, and it doesn’t mean that I was those people. Besides, I have tried to fix the seed for several times and many strategies before, but nothing works.
@sshaoshuai Excuse me! could you please share me how long will you disucess about this question? this problem blocks my project progress!