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

BabyAI-Text: Reproducing the same game using seed parameter #33

Open
HRezaei opened this issue Feb 24, 2025 · 2 comments
Open

BabyAI-Text: Reproducing the same game using seed parameter #33

HRezaei opened this issue Feb 24, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@HRezaei
Copy link
Contributor

HRezaei commented Feb 24, 2025

I'm trying to re-run a specific game over and over again. Assuming that the name of the game and seed are enough to generate the same game, I'm getting a different rendered grid every time with the same parameters!

name_env = 'BabyAI-MixedTrainLocal-v0'
env = gym.make(name_env, seed=100)
env.reset()
image = env.render(mode='rgb_array')

I tried to put up a short code for reproducing the bug, but struggled with installing the packages on Google Colab. Anyway, below is the link, if you manage to run the very last block multiple times, you'll see it renders a different layout, even though the seed and game name are not changed.

https://colab.research.google.com/drive/156zH3Z6ZyEPRaR4v3tsW_CJmg-k0xA0B?usp=sharing

Is there any other parameter I need to fix in order to get the same game all the time?

@ClementRomac
Copy link
Contributor

Hi,

This is weird indeed, let me try to figure out what is happening.

@ClementRomac
Copy link
Contributor

I found two issues in the current code thanks to your example:

  • BabyAI's generation is properly seeded
  • The issue only happens when using our "Mixed" environments
  • First, the task selection (i.e. whether the instruction should be GoTo, Pickup...) is not seeded
  • Second, our generation for the PutNextTo tasks is not properly seeded as well

This should be pretty easy to fix as all the problems come from this file. I have a relatively low bandwidth this week, but I can try my best to propose a fix. Feel free to propose one otherwise :)

@ClementRomac ClementRomac self-assigned this Feb 24, 2025
@ClementRomac ClementRomac added the bug Something isn't working label Feb 24, 2025
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