-
Notifications
You must be signed in to change notification settings - Fork 60
[BUG] Inconsistent environment seeding #53
Comments
Hi @jlin816 Thanks for pointing this out and apologies for a late reply. I see where the issue is. Firstly, MiniHack's seeding is slightly different from that of NLE's. The Lines 175 to 177 in 2054e7f
Specifically, when a Lines 325 to 327 in 2054e7f
I understand this made the Here is the PR #68. Please let me know if it works for you. |
With this new PR, here is how one would use the seeding functionality import minihack, gym
env = gym.make("MiniHack-KeyRoom-Fixed-S5-v0",
observation_keys=("pixel", "colors", "chars", "glyphs", "tty_chars"),
seeds=[1, 3, 9, 27]) For now let's sample random episodes a few times obs = env.reset()
env.render()
print(env.get_seeds()) This outputs
or perhaps
Now when we manually set the seed and use env.seed(42, 42, False)
obs = env.reset(sample_seed=False)
env.render()
print(env.get_seeds()) will result in the following.
|
🐛 Bug
Seeding doesn't consistently generate the same environment.
To Reproduce
Steps to reproduce the behavior:
Sometimes this prints
But also occasionally prints (note the printed seeds are
(0, 0, False)
):Expected behavior
Same positions of agent/key, and same seeds being printed by
env.get_seeds()
Environment
The text was updated successfully, but these errors were encountered: