Inconsistent results despite setting seed for reproducibility
#1
by
petchpanu
- opened
I've been working with a quantized model, and it has produced very satisfying results so far. However, I've noticed that the results are not always consistent, even when I set the seed.
Here is the code I'm using to set the seed:
import numpy as np
import torch
seed = 0
torch.manual_seed(seed)
set_seed(seed)
# Set seed for Python's random module
random.seed(seed)
# Set seed for NumPy
np.random.seed(seed)
# Set seed for PyTorch (if using a GPU, use the optional torch.cuda.manual_seed)
torch.manual_seed(seed)
if torch.cuda.is_available():
torch.cuda.manual_seed(seed)```
Is it normal for the results to still vary despite setting the seed?
petchpanu
changed discussion status to
closed