We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有没有人在训练时遇到每次训练结果不一样的情况,在一开始已经设定了随机种子固定,调试发现,模型在第一次更新参数前是完全一致的,相同的输出产生相同的预测、loss,但是经过一次参数更新后,模型参数和预测就不一样了,这是哪里还有随机的部分没被固定? def set_seed(random_seed): random.seed(random_seed)
# NumPy np.random.seed(random_seed) # PyTorch torch.manual_seed(random_seed) # if torch.cuda.is_available(): torch.cuda.manual_seed(random_seed) torch.cuda.manual_seed_all(random_seed) torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False
The text was updated successfully, but these errors were encountered:
No branches or pull requests
有没有人在训练时遇到每次训练结果不一样的情况,在一开始已经设定了随机种子固定,调试发现,模型在第一次更新参数前是完全一致的,相同的输出产生相同的预测、loss,但是经过一次参数更新后,模型参数和预测就不一样了,这是哪里还有随机的部分没被固定?
def set_seed(random_seed):
random.seed(random_seed)
The text was updated successfully, but these errors were encountered: