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

reproduce the results #94

Open
ChenyangRan opened this issue Jun 13, 2024 · 2 comments
Open

reproduce the results #94

ChenyangRan opened this issue Jun 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ChenyangRan
Copy link

Hi, since the panda-gym cannot set the random seed as gym, where you can use env.set(seed) to reproduce the results.
When I use env.reset(seed=10), if the random seed is the same, I get the same return value, such as desired_goal. But if I don't set the seed, I can't guarantee the consistency of the state of the subsequent env.resets. Is there a way to guarantee the consistency of the state of each subsequent reset just like gym?

@ChenyangRan ChenyangRan added the question Further information is requested label Jun 13, 2024
@qgallouedec
Copy link
Owner

Hey, thanks for the question. It seems like a bug, I'll fix it.

@qgallouedec
Copy link
Owner

I've only managed to solved the issue with some environments. I can't solve it for the others.
The discussion is also ongoing here: Farama-Foundation/Gymnasium#1111

  • PandaReach-v3
  • PandaReachJoints-v3
  • PandaReachDense-v3
  • PandaReachJointsDense-v3
  • PandaSlide-v3
  • PandaSlideJoints-v3
  • PandaSlideDense-v3
  • PandaSlideJointsDense-v3
  • PandaPush-v3
  • PandaPushJoints-v3
  • PandaPushDense-v3
  • PandaPushJointsDense-v3
  • PandaPickAndPlace-v3
  • PandaPickAndPlaceJoints-v3
  • PandaPickAndPlaceDense-v3
  • PandaPickAndPlaceJointsDense-v3
  • PandaStack-v3
  • PandaStackJoints-v3
  • PandaStackDense-v3
  • PandaStackJointsDense-v3
  • PandaFlip-v3
  • PandaFlipJoints-v3
  • PandaFlipDense-v3
  • PandaFlipJointsDense-v3

To reproduce

import panda_gym
import gymnasium as gym
from gymnasium.utils.env_checker import data_equivalence


env = gym.make("PandaPickAndPlace-v3")

action_0 = env.action_space.sample()
action_1 = env.action_space.sample()

_, _ = env.reset(seed=10)
obs_00, _, _, _, _ = env.step(action_0)
_, _ = env.reset()
obs_01, _, _, _, _ = env.step(action_1)

_, _ = env.reset(seed=10)
obs_10, _, _, _, _ = env.step(action_0)
_, _ = env.reset()
obs_11, _, _, _, _ = env.step(action_1)

assert data_equivalence(obs_00, obs_10) 
assert data_equivalence(obs_01, obs_11)

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

No branches or pull requests

2 participants