Fix Model Output for Same Input

Following is the picture of my model
image

When I give one input two times, the output is different. I want the output to be same for same input.

If anyone can help please? I have tried the following but didn’t find helpful

torch.manual_seed(123)
torch.cuda.manual_seed(123)
torch.cuda.manual_seed_all(123)
np.random.seed(123)
torch.backends.cudnn.deterministic=True

Thank you

Did you make sure to call model.eval() before running the comparison?
This will make sure to disable dropout layers and use the running stats from batchnorm layers instead of the current batch statistic.

Also, note that some operations include atomicAdd as described here, which will not yield deterministic results.