-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
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
The random seed doesn't work #33
Comments
Can you give an example with what you expected to happen and what actually happened? If tensorflow is failing to set a set, maybe you should file a bug on tensorflow. For gym environments and numpy (for example) are seeded differently, and you should not expect seeding tensorflow to affect either of them. |
Ooh, I may not have seeded Gym envs. My bad. Will look into getting this working---it's possible that Gym isn't the only other source of nondeterminism (they can be hard to track down). |
@machinaut @jachiam ,I run the common env.seed(seed)
test_env.seed(seed) but the AverageTestEpRet of epoch one was still different. |
@xffxff, hmm, that's a bit unfortunate. I appreciate that you tried this out. I am not fully sure what could be going wrong here. My suspicion is that it might involve the Python hash seed used to prevent dict collision attacks. See here for an explanation of the issue, and see here for more info. Can you try |
@xffxff I tried out Results from first run:
Results from second run:
Looks like this solves the issue. I'm going to mark this as closed. |
Scratch that, double-checking and it looks like things diverge after Epoch 1. Don't know where this nondeterminism is coming from. |
With env seed setting and |
Is this issue happening in both tensorflow and pytorch? Have the operation-level seeds been properly set? |
With following env seed setting env.seed(seed)
env.action_space.seed(seed)
test_env.seed(seed)
test_env.action_space.seed(seed) the result is same in same seed. |
Even if I set the same random seed, the result is different, and you can test it on ddpg. I think
tf.set_random_seed(seed)
doesn't work, but I don't know how to solve it.The text was updated successfully, but these errors were encountered: