torch.manual_seed()
random.seed(args.seed)
np.random.seed(args.seed)
torch.set_deterministic(True)
cudnn.benchmark = True
当cudnn.benchmark和set_deterministic同时为True,也会搜索最快的卷积算法。
pytorch 官方文档:https://pytorch.org/docs/stable/notes/randomness.html
torch.manual_seed()
random.seed(args.seed)
np.random.seed(args.seed)
torch.set_deterministic(True)
cudnn.benchmark = True
当cudnn.benchmark和set_deterministic同时为True,也会搜索最快的卷积算法。
pytorch 官方文档:https://pytorch.org/docs/stable/notes/randomness.html