-
-
Notifications
You must be signed in to change notification settings - Fork 613
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
Continuation of: Add babyai bot and test #381
Continuation of: Add babyai bot and test #381
Conversation
Can't find a contributing.md |
plus some minor changes to pass pre-commit hooks
The bot fails to complete 4/96 possible environments, with "nothing left to explore" Other than that, I've integrated all the changes requested by @pseudo-rnd-thoughts on #356. Opening for review. |
Sorry, I have no idea. @BolunDai0216 any ideas otherwise we could ask the original babyai authors |
Sorry, I'm not very familiar with the bot's implementation, I think we should ask the ask the original babyai authors. |
@saleml @maximecb @rizar could any of you comment on this (#381 (comment))? The environments where the bot fails are:
For reference, these environments are registered here. Thanks! |
I'm the meantime, can we check that the environment is solve. I.e, with a known initial seed and list of actions always terminate the environment |
I'm not sure what you mean |
My thinking is, if the solver is not able to solve the environment then there are two reasons
As the solver is more complex, is easier if we see if the first one is the issue env = gym.make("env-id")
actions = []
env.reset()
for action in actions:
_, reward, terminated, truncated, _ = env.step(action)
assert terminated is False
assert reward > 0 # I'm guessing this is correct We just need to find a list of actions that pass the bottom two tests If this works, we can use it test the solver and at what point it fails |
I think its the environment that has a "bug", although I don't know if you would class it as much. The missions generated simply seem impossible for the environment considered. See the following examples for each of the first three failing envs BabyAI-PutNextS5N2Carrying-v0 BabyAI-PutNextS6N3Carrying-v0 BabyAI-PutNextS7N4Carrying-v0 BabyAI-KeyInBox-v0 I am not sure what's wrong with the final env: |
See also mila-iqia/babyai#121 (comment) mentioning the same envs as #381 (comment) as having issues |
Could you check the related paper to BabyAI and see what results they have. I.e., there may have been a time when this was solvable but just not now. I'm a bit worried that there is a larger issue behind this one which is the cause. |
Looked at the original paper (link).
Upon further inspection, these are in fact from the "Bonus Levels", listed here with the following blurb:
I am not sure these levels were ever covered by the Bot. Perhaps we can provide a warning (or NotImplementedError) when instantiating the Bot with one of these 4 levels stating that they are not covered. |
@thesofakillers I think that is fair solution to disable their testing with a note in the docstring Is part of the issue that the environments are not solvable in the first place? |
I think this may be the case for the PutNextCarrying envs, at least visually. Perhaps the authors originally had an additional proprioceptive state dimension specifying what object the agent is carrying. I'm not sure exactly why KeyInBox is breaking.
I can go ahead and disable their testing. What docstring exactly did you have in mind? The Bot's? |
Yes I think so and if possible in the environment docstring as well |
Ok, done. |
Seems like for certain seeds, the Bot gets stuck (or just takes a very long time) on some of the envs. I think this is why the tests are taking so long for certain python versions. I can find a seed that works, or we can set a max number of steps, although this may cause the Bot to fail occasionally and not pass the tests. Could also keep trying a different seed with a max number of steps until the bot is succesful |
@pseudo-rnd-thoughts let me know what you think about my previous comment, seems it leads to OOM errors eventually based on the results of the checks. I've implemented the third option (keep trying a different seed with a max number of steps until the bot is succesful), which is what most repos using the Bot do from what I can tell. I can commit and push if you think this is sensible |
@thesofakillers Sorry, I have been ill for the last few days, yes, I think that plan would be great |
Done. No worries! Hope you feel better! |
Description
Continues #356:
Fixes #308
Type of change
Please delete options that are not relevant.
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)