Skip to content
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

[BUG] Action Space seeding doesn't work in some cases #207

Closed
3 tasks done
nico-bohlinger opened this issue Oct 25, 2022 · 0 comments · Fixed by #211
Closed
3 tasks done

[BUG] Action Space seeding doesn't work in some cases #207

nico-bohlinger opened this issue Oct 25, 2022 · 0 comments · Fixed by #211
Assignees
Labels
bug Something isn't working

Comments

@nico-bohlinger
Copy link

Describe the bug

Setting the seed in the action space only seems to work when copying the action space to a variable. Which seems like really odd behavior. I would also expect that setting the seed in envpool.make would be enough.

To Reproduce

import envpool


actions = []
for i in range(2):
    env = envpool.make("Humanoid-v4", env_type="gym", num_envs=1, seed=1)
    action_space = env.action_space
    action_space.seed(1)
    action = action_space.sample()
    actions.append(action)
print(actions[0] == actions[1])
# Outputs:
# [ True  True  True  True  True  True  True  True  True  True  True  True
# True  True  True  True  True]

actions = []
for i in range(2):
    env = envpool.make("Humanoid-v4", env_type="gym", num_envs=1, seed=1)
    env.action_space.seed(1)
    action = env.action_space.sample()
    actions.append(action)
print(actions[0] == actions[1])
# Outputs:
# [False False False False False False False False False False False False
# False False False False False]

System info

import envpool, numpy, sys
print(envpool.__version__, numpy.__version__, sys.version, sys.platform)

0.6.5 1.23.4 3.9.7 (default, Sep 16 2021, 13:09:58)
[GCC 7.5.0] linux

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have read the documentation (required)
  • I have provided a minimal working example to reproduce the bug (required)
nico-bohlinger added a commit to nico-bohlinger/RL-X that referenced this issue Oct 25, 2022
@Trinkle23897 Trinkle23897 added the bug Something isn't working label Oct 26, 2022
@Trinkle23897 Trinkle23897 changed the title Action Space seeding doesn't work in some cases [BUG] [BUG] Action Space seeding doesn't work in some cases Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants