Open YanLiang1102 opened 3 years ago
If you're using cuda, you probably need to define/run a function to set the seed manually for each library at the beginning of your code. Something like:
def fix_seeds(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
fix_seeds(42)
This is because each library has its own seed for randomization that it uses for initialization.
I saw the seed is being set in the notebook, but did not find its reference in the source code.