Giter Site home page Giter Site logo

mila-iqia / babyai Goto Github PK

View Code? Open in Web Editor NEW
677.0 36.0 144.0 71.97 MB

BabyAI platform. A testbed for training agents to understand and execute language commands.

License: BSD 3-Clause "New" or "Revised" License

Python 99.77% Dockerfile 0.23%
nlp nlp-machine-learning reinforcement-learning-environments imitation-learning openai-gym

babyai's Introduction

Build Status

2023 update

All BabyAI environments are now part of the Minigrid library. This repository is not actively maintained.

Training RL agents on Minigrid (and BabyAI) environments can be done using this repository.

This repository still contains scripts which, if adapted to the Minigrid library, could be used to:

BabyAI 1.1

BabyAI is a platform used to study the sample efficiency of grounded language acquisition, created at Mila.

The master branch of this repository is updated frequently. If you are looking to replicate or compare against the baseline results, we recommend you use the BabyAI 1.1 branch and cite both:

@misc{hui2020babyai,
    title={BabyAI 1.1},
    author={David Yu-Tung Hui and Maxime Chevalier-Boisvert and Dzmitry Bahdanau and Yoshua Bengio},
    year={2020},
    eprint={2007.12770},
    archivePrefix={arXiv},
    primaryClass={cs.AI}
}

and the ICLR19 paper, which details the experimental setup and BabyAI 1.0 baseline results. Its source code is in the iclr19 branch:

@inproceedings{
  babyai_iclr19,
  title={Baby{AI}: First Steps Towards Grounded Language Learning With a Human In the Loop},
  author={Maxime Chevalier-Boisvert and Dzmitry Bahdanau and Salem Lahlou and Lucas Willems and Chitwan Saharia and Thien Huu Nguyen and Yoshua Bengio},
  booktitle={International Conference on Learning Representations},
  year={2019},
  url={https://openreview.net/forum?id=rJeXCo0cYX},
}

This README covers instructions for installation and troubleshooting. Other instructions are:

Installation

Conda (Recommended)

If you are using conda, you can create a babyai environment with all the dependencies by running:

git clone https://github.com/mila-iqia/babyai.git
cd babyai
conda env create -f environment.yaml
source activate babyai

After that, execute the following commands to setup the environment.

cd ..
git clone https://github.com/maximecb/gym-minigrid.git
cd gym-minigrid
pip install --editable .

The last command installs the repository in editable mode. Move back to the babyai repository and install that in editable mode as well.

cd ../babyai
pip install --editable .

Finally, follow these instructions

Manual Installation

Requirements:

  • Python 3.6+
  • OpenAI Gym
  • NumPy
  • PyTorch 0.4.1+
  • blosc

First install PyTorch for on your platform.

Then, clone this repository and install the other dependencies with pip3:

git clone https://github.com/mila-iqia/babyai.git
cd babyai
pip3 install --editable .

Finally, follow these instructions

BabyAI Storage Path

Add this line to .bashrc (Linux), or .bash_profile (Mac).

export BABYAI_STORAGE='/<PATH>/<TO>/<BABYAI>/<REPOSITORY>/<PARENT>'

where /<PATH>/<TO>/<BABYAI>/<REPOSITORY>/<PARENT> is the folder where you typed git clone https://github.com/mila-iqia/babyai.git earlier.

Models, logs and demos will be produced in this directory, in the folders models, logs and demos respectively.

Downloading the demos

These can be downloaded here

Ensure the downloaded file has the following md5 checksum (obtained via md5sum): 1df202ef2bbf2de768633059ed8db64c

before extraction:

gunzip -c copydemos.tar.gz | tar xvf -

Using the pixels architecture does not work with imitation learning, because the demonstrations were not generated to use pixels.

Troubleshooting

If you run into error messages relating to OpenAI gym, it may be that the version of those libraries that you have installed is incompatible. You can try upgrading specific libraries with pip3, eg: pip3 install --upgrade gym. If the problem persists, please open an issue on this repository and paste a complete error message, along with some information about your platform (are you running Windows, Mac, Linux? Are you running this on a Mila machine?).

Pixel Observations

Please note that the default observation format is a partially observable view of the environment using a compact encoding, with 3 input values per visible grid cell, 7x7x3 values total. These values are not pixels. If you want to obtain an array of RGB pixels as observations instead, use the RGBImgPartialObsWrapper. You can use it as follows:

import babyai
from gym_minigrid.wrappers import *
env = gym.make('BabyAI-GoToRedBall-v0')
env = RGBImgPartialObsWrapper(env)

This wrapper, as well as other wrappers to change the observation format can be found here.

babyai's People

Contributors

anoperson avatar bharatr21 avatar bolundai0216 avatar chitwansaharia avatar dmitriy-serdyuk avatar dyth avatar emailweixu avatar genius1237 avatar lcswillems avatar mattdeitke avatar maximecb avatar perone avatar planetceres avatar rizar avatar saizheng avatar saleml avatar simon555 avatar thomasaunger avatar tristandeleu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

babyai's Issues

enjoy.py script seems to expect old PyQT version of gym-minigrid

I wanted to watch the planning bot solve the Boss Levels, so I ran the command ./scripts/enjoy.py --env BabyAI-BossLevel-v0 --model BOT and got this error:

(babyai) [~/work/babyai] ./scripts/enjoy.py --env BabyAI-BossLevel-v0 --model BOT
Mission: open a yellow door and open the grey door on your right
step: 0, mission: open a yellow door and open the grey door on your right
Traceback (most recent call last):
  File "./scripts/enjoy.py", line 119, in <module>
    if renderer.window is None:
AttributeError: 'numpy.ndarray' object has no attribute 'window'

Commenting out the lines

    if renderer.window is None:
        break

at the bottom of enjoy.py made the command work (although closing the window in the GUI caused a problem).

But then I wanted to try manual-mode and I got another error:

(babyai) [~/work/babyai] ./scripts/enjoy.py --env BabyAI-BossLevel-v0 --model BOT --manual-mode
Mission: open a yellow door and open the grey door on your right
Traceback (most recent call last):
  File "./scripts/enjoy.py", line 96, in <module>
    if args.manual_mode and renderer.window is not None:
AttributeError: 'numpy.ndarray' object has no attribute 'window'

Looking into the code a little more, it seems that enjoy.py is expecting an old version of gym-minigrid that was based on PyQT, and that is causing these errors. In fact, if I go back to an old commit of gym-minigrid
(commit 50f396a9bf39952e5ab1bd13b422f258eb29f954) and re-do pip3 install -e . in my gym-minigrid repo using that commit, enjoy.py works properly, but unfortunately that old commit of gym-minigrid is incompatible with other scripts like /scripts/manual_control.py.

It looks like enjoy.py was never updated after the change to gym-minigrid.

> Thanks

@rizar

Thanks

Even in the instructions like Pickup the blue ball and go to the red ball, you still need to remove the drop subgoal even if the pickup is not the last thing that needs to be done.
A possible solution I can think of is post-processing stack inserting drop subgoal between every two Pickups (inserting it just before latter Pickup subgoal). Do you think this approach is okay ? @rizar

Originally posted by @chitwansaharia in #80 (comment)

Google Colab

Hello, thanks for your work.

Would it be possible to run BabyAI on Google Colab? I assume there would be some technical difficulties but perhaps someone has been able to do so.

Thanks in advance.

get rid of GoToAdjPos

GoToAdjPos can be implemented as a special case of GoToObj and GoNextTo. We discussed this with @saleml , and he was willing to implement this.

Question about performance

I'm reading through the babyAI paper and I see that the RL sample-efficiency for "GoToRedBallGrey" is ~34. Am I to understand from this that from completing 34 episodes (w/ either success or failure), the agent was able to get a 99% success rate? The code does 64 processes in parallel. Does that mean that after I single iteration of going through the episode once, the agent is able to get 99% success rate? I'm very surprised by this

PutNextLocal

I haven't been able to get 99% success rate for PutNextLocal. Are the default command-line arguments correct for that task? I plateau at about 65-70% success rate.

What does the agent see, in 7x7? -- possible bug in the task?

Hello! I am currently running the task GoToRedBallGrey with the settings bow_endpool_res.
According to the babyai paper, the observations should be 7x7x3 showing the pixels in front.

However, here are 3 different episodes that I saved which confused me alot.

It is not clear to me where the agent is in the 7x7x3 screen?

Moreover, in both of these trajectories, sometimes the field of view moves, --- and --- sometimes a pixel in the environment moves. It is unclear to me how this corresponds to an agent-centric point of view in GoToRedBallGrey -- hence I want to ask if there is possibly a bug in the implementation of the GoToRedBallGrey task

Movie_babya5
Movie_babyai4
Movie_babyai3
to me).

(By contrast, when I tried the 56x56x3 screen that you get when you run setting pixels_endpool_res, the agent is very obvious (red triangle) and everything in that setting is clear

Any insight into this matter would be really really awesome! Thanks in advance! :)

reseed the rng for every mission when generating demos

It is currently very tricky to debug occasional bot failures because the environment needs to be reset a number of times. Perhaps we could reseed the random number generator for every mission. The only pitfall I can think of is that we should still make sure that the resulting data never overlaps with validation or test sets.

bot crash

When I am generating demonstrations for the BossLevel, I get this:

2019-01-04 14:28:54,300: ERROR: error while generating demo #325
Traceback (most recent call last):
  File "scripts/make_agent_demos.py", line 96, in generate_demos
    action = agent.act(obs)['action']
  File "/home/dzmitry/Dist/baby-ai-game/babyai/utils/agent.py", line 150, in act
    action = self.bot.get_action()
  File "/home/dzmitry/Dist/baby-ai-game/babyai/bot.py", line 1247, in get_action
    action = subgoal.get_action()
  File "/home/dzmitry/Dist/baby-ai-game/babyai/bot.py", line 478, in get_action
    return self.subgoal_accomplished()
  File "/home/dzmitry/Dist/baby-ai-game/babyai/bot.py", line 69, in subgoal_accomplished
    return subgoal.get_action()
  File "/home/dzmitry/Dist/baby-ai-game/babyai/bot.py", line 329, in get_action
    return self.subgoal_accomplished()
  File "/home/dzmitry/Dist/baby-ai-game/babyai/bot.py", line 69, in subgoal_accomplished
    return subgoal.get_action()
  File "/home/dzmitry/Dist/baby-ai-game/babyai/bot.py", line 194, in get_action
    obj_pos = self.bot.find_obj_pos(key_desc)
  File "/home/dzmitry/Dist/baby-ai-game/babyai/bot.py", line 985, in find_obj_pos
    assert len(obj_desc.obj_set) > 0
AssertionError

Unless this stack trace is immediately meaningful for anyone, I'm going to dig into it myself.

go straight for the key when you head for locked door

Out of the suboptimal things that the bot does, this one stands out --- why go to the locked door without the key if you know it's locked?? Should be not too hard to fix, but will require full-scale testing (as usual).

Sampling unsolvable demonstrations

Hi, is there anyway efficient way to generate unsolvable demonstrations? It seems that some levels have a 100% rate of getting solvable initialized grids, but, for example, in BossLevel the generator may produce unsolvable cases. Thanks!

Bug in BOT Stack for PickupLoc

The BOT stack for BabyAI-PickupLoc-v0 contains a drop subgoal. It is due to the fact that every pickup subgoal automatically adds a drop subgoal. However, for PickupLoc, when the BOT needs to act done after finishing all the subgoals will end up failing the mission, as it would have dropped the object already. @rizar

bot failing some missions

The bot fails the mission #1308. I investigated, and here is what happens. Let's look at https://github.com/mila-udem/babyai/blob/9ed5e0db5692f6229dbe339d2d597e863d4dd9de/babyai/bot.py#L1210

What seems to happen here is that after the agent picks up an object, it may have to drop it before it reaches the location where the object must be dropped. For example, if the instruction is "put a ball next to the red door", and if the ball needs to be dropped on the way to the red door in order to unblock the path, the bot gets lost. Is my reasoning correct?

To fix this issue one would need to change the behavior of GoTo... subgoals in a way that the agent does not lose what it's carrying. Would that be a reasonable solution?

looking for very very blocked objects

In the example below, the red ball is blocked from all directions. The box can't handle such cases currently.

image

Clearly, even more contrived examples of this kind can be constructed. I am now reading the bot's code to see if we can come up with a rather general heuristic to unblock objects that are "way too blocked".

Headless rendering issue for environments with doors

Hi, I am experiencing an issue rendering the frames using env.render(mode='rgb_array'). For some reason this issue seems to be specific to environments that contain doors. The rendering looks like this:

image

Attached is an ipython notebook with some examples. This seems to be an issue with both the BabyAI and Minigrid environments. Would you have some pointers or suggestions on how to fix this?

Debug Rendering.pdf

Thanks!

Integration / training tests

Test that a model can be trained to a high success rate on a smaller version of the BossLevel. This will likely take hours. Ideally it should be a scheduled job that runs on the Mila cluster. This task is currently on hold until the cluster is in a fully working state.

Not getting the success rate mentioned in the paper using the pretrained models.

Hi,
I tried to evaluate the baselines using the pretrained models provided in the docker image for the levels GoToSeq, and PickupLoc. I used the il pretrained model (GoToSeq-1) for the former environment, and the rl pretrained model (PickupLoc-4_best) for the latter. I was expecting to get success rates approximately equal to what has been mentioned in the paper, but I got only 13%, and 65% for the respective cases.
I just ran the evaluate.py script giving in the correct arguments for the mentioned environments and the models. I even ran the enjoy.py script to visualize the performance of these models, but even that did not seem to be too good.
Am I doing something wrong over here, or are these not the best pretrained models?
I have attached the output for the respective evaluation runs for the two cases.
gotoseq-1_results
pickuploc-4_best_results png
Thanks.

do we really need both test_mission_gen.py and gui.py?

We currently have two simple scripts to visualize BabyAI levels. Should we delete one of them? Do we really need both of them? If we do need both of them, we should make their API consistent (right now --env-name in gui.py must be of the form BabyAI-XXX-v0, whereas --level-name in test_mission_gen.py must be just XXX).

AttGRU model is broken + my quick Fix

when i start train_rl of the iclr19 branch with:
--env BabyAI-PickupLoc-v0 --recurrence 20 --memory-dim 2048 --instr-arch "attgru" --tb --procs 64
(this should be the Large model from your paper)

the program crashes at this line in model.py:

def forward(self, obs, memory, instr_embedding=None,ret_embed=False):
...
pre_softmax = (keys[:, None, :] * instr_embedding).sum(2) + 1000 * mask

with the message
RuntimeError: The size of tensor a (8) must match the size of tensor b (9) at non-singleton dimension 1

to fix it i looked into

def _get_instr_embedding(self, instr):
...

 if outputs.shape[1] < masks.shape[1]:
                masks = masks[:, :(outputs.shape[1]-masks.shape[1])]
                # the packing truncated the original length
                # so we need to change mask to fit it

            return outputs if self.lang_model == 'attgru' else final_states

the line were masks is changed has no effect on outputs.

So i copied the if statement into the forward method and changed


        if self.use_instr and self.lang_model == "attgru":
            # outputs: B x L x D
            # memory: B x M
            mask = (obs.instr != 0).float()
            instr_embedding = instr_embedding[:, :mask.shape[1]]

to


        if self.use_instr and self.lang_model == "attgru":
            # outputs: B x L x D
            # memory: B x M
            mask = (obs.instr != 0).float()
            # my quick fix stolen from:      self._get_instr_embedding(obs.instr)
            if instr_embedding.shape[1] < mask.shape[1]:
                mask = mask[:, :(instr_embedding.shape[1]-mask.shape[1])]
            #end of my fix
            instr_embedding = instr_embedding[:, :mask.shape[1]]

and the program runs again.

Do you think this is sufficient or did i forget something?

Thanks in advance

EDIT:
this error does not occur in BabyAI-PutNextLocal-v0 or BabyAI-GoToLocal-v0
maybe it is specific to BabyAI-PickupLoc-v0

How to measure RL sample efficiency

Hi,

My question relates to the RL results in Table 3 of the paper. Iโ€™m trying to use the iclr19 branch to generate at least 10 such results (for each level) to get stable mean and variance. The train_rl.py script seems to do almost everything required. But at the bottom of that file, after calculating the success rate over the (default of 512) episodes that were tested, the success rate is not actually logged. The mean return is logged instead.

Adding the following line (right after the calculation of success_rate) seems to log the missing number:

logger.info("Success rate {: .4f} reached after {} training episodes".format(success_rate, status['num_episodes']))

Also, it seems that the default save_interval of 1000 is too large for some of the easier levels. For instance, to get sufficiently frequent tests on GoToRedBallGrey, I call the script like this:

python scripts/train_rl.py --env BabyAI-GoToRedBallGrey-v0 --save-interval 10

Then to obtain the sample efficiency, I just look in the log for the first success rate to exceed 0.99, and take the number of training episodes up to that point. For seed=1, it happens on this line:

main: 2019-06-17 01:27:36,671: Success rate 0.9922 reached after 30769 training episodes

Is this the right way to generate more RL results like those in Table 3? Or is there an easier way?

Thank you for this excellent environment!

Build-essential missing from Linux instructions

I was delighted to see the environment seems 100% functional in Windows 10 with the conda method. On Linux though, conda again, the last pip fails, apparently some compilation facility is required, Ubuntu the build-essential package was enough.

Visualizing stored "images"

Question:
I am storing whole episodes in a buffer. Is it possible to visualize the 7x7x3 "images" like you did in the paper?
I want to pass the "image" matrix to a function and get a rendered picture, where I see all the objects and their color like in the BabyAI paper.

Thanks in advance!

You cannot pick up or put down objects in manual-mode in enjoy.py

When I run the command
./scripts/enjoy.py --env BabyAI-BossLevel-v0 --model BOT --manual-mode
I cannot pick up or put down any objects manually. I can execute other commands manually like moving or opening doors. If I keep hitting <RETURN> to have the BOT execute commands, it picks up objects and puts them down fine. I can pick up objects and put them down fine using
./scripts/manual_control.py --env BabyAI-BossLevel-v0 with the <PageUp> and <PageDown> keys, but in enjoy.py, the <PageUp> and <PageDown> keys are being recorded in the terminal, but the action is not taking place.

Revised article TODO

Here is a list of things to complete for the revised article. Most of these will probably be done in January:

  • Investigate one-hot representation of observations, validate performance effect (Maxime)
    • Effect is mixed, not clearly beneficial
  • Validate and test new bot (Salem)
  • Add bibtex for BabyAI paper to repo
  • Deanonymize paper
  • Regenerate all demonstrations (depend on new bot)
  • Re-run all experiments, retrain all models (Dima)
  • Update results in paper
  • Update bot diagrams in paper
  • Last proofreading pass on revised paper
  • Update paper on OpenReview/arXiv
  • Repackage and reupload new demos on website
  • Regenerate Docker container with new trained models
  • Document commands used to train big & small models in iclr19 branch README

Camera-ready deadline is February 22nd.

Error in docs/train-eval.md?

Maybe I am a machine and I do not know this but in Training section

A machine readable log can be found in logs//log.csv, a human readable in logs//log.log.

It seems to me that .csv is the a human readable log and .log is the machine readable log, or am I missing something?

Mission not accomplished in the last observation

Hi,

I was visualising the last observation of each demonstration generated by the bot and I found that the goal was not achieved in the last observation too. Are the goals not achieved in all the generated demonstrations or am I making some mistake here? Please let me know. I used the following code for visualising the last obs in the demo. I have also attached some of the images of the last observationns for the "GoToRedBall" level. Most of them also don't have the red ball so I am just wondering if I am doing something wrong.

obs = obs_traj[-1,:,:,:]
r=env.get_obs_render(obs.cpu().numpy(), 128)
cv2.imwrite(f'./images/textImage.png',r)

textImage65
textImage399

Thanks

Unable to run PPO agent with arch=bow_endpool_res_pixels

Hey!
I am new to DeepRL and am implementing a paper in the BabyAI environment.
I am trying to run the default ppo algorithm using the train_rl.py script however, I am unable to when I set the flag arch = 'bow_endpool_res_pixels'
The error I get is when the image_conv is applied and says that:
RuntimeError: Given groups=1, weight of size [128, 3, 8, 8], expected input[64, 128, 56, 56] to have 3 channels, but got 128 channels instead
Thanks!

Scrap cnn1, cnn2, etc?

Seeing we use expert_filmcnn pretty much all the time, should we scrap cnn1, cnn2, all the pieces we don't use in the model?

Potential initialisation error of self.mask in base.py

self.mask here is initialised as an array of 1s. However, when flattening out the mask here it will be buggy. Here is an example to illustrate the problem.
num_procs = 2, num_frames_per_proc = 4
After accumulating the experience, self.masks would be something like this :
[1, x, x, x
1, x, x, x]
When flattening it out, it will look like this : [1, x, x, x, 1, x, x, x] which should ideally be [0, x, x, x, 0, x, x, x]

Missing dependency for scikit-build

Whilst installing BabyAI with conda on compute-canada, I encounted an error no module named skbuild during the very last step pip install --editable ..
Some googling revealed that this was caused by a missing package named scikit-build, which can installed by pip install scikit-build.
Hence this issue could be resolved by adding scikit-build to environment.yaml under pip.

However, I am unsure whether this is caused by an out-of-date version of miniconda on Compute Canada, or a missing dependency in BabyAI or MiniGrid.

Know full vocabulary apriori.

Hello,

Is it possible to know the full vocabulary apriori? I plan to run the envs in parallel processes, with optimization/env steps happening in parallel. If I do this, each process has its own agent, but then the {str:index} correspondence won't be consistent. Reading the paper, I'm under the impression this is a closed/fixed vocabulary?

Publish pip package

Hello,

I would like to know if the team has plans to publish a pip package for BabyAI anytime soon. It would be very useful to automate installation.

Thanks for the incredible work and support!

Document how to create new levels

Create a markdown document with some explanations on how level generation works in BabyAI and how to create custom levels. This would go under /docs.

More broadly, I'd like to split up the README into more sub-documents, as I've done in the MiniWorld repo. Keep only introduction, installation and basic usage into the main README. Everything else goes into smaller markdown documents about specific topics.

Bot bugs (attribute error: prev_carrying)

When running the bot on all levels, from time to time I experience the following errors:
AttributeError: 'Bot' object has no attribute 'prev_carrying' (bot.py:125)
AttributeError: 'Bot' object has no attribute 'prev_fwd_cell' (bot.py:947)

It happens on some episodes e.g. on the level Open or Pickup.

What's the package version of gym-minigrid and gym used for the baseline results?

Hi. It seems that the gym and gym-minigrid versions are not specified in the repo. I tried gym-minigrid==1.0.2 and gym==0.24.1, and it gives the following error when I run scripts/train_rl.py --env BabyAI-GoToLocal-v0:

Traceback (most recent call last):
  File "scripts/train_rl.py", line 114, in <module>
    reshape_reward)
  File "/home/lthpc/Desktop/babyai/babyai/rl/algos/ppo.py", line 22, in __init__
    aux_info)
  File "/home/lthpc/Desktop/babyai/babyai/rl/algos/base.py", line 82, in __init__
    self.obs = self.env.reset()
  File "/home/lthpc/Desktop/babyai/babyai/rl/utils/penv.py", line 42, in reset
    results = [self.envs[0].reset()] + [local.recv() for local in self.locals]
  File "/home/lthpc/anaconda3/envs/babyai/lib/python3.7/site-packages/gym/wrappers/order_enforcing.py", line 42, in reset
    return self.env.reset(**kwargs)
  File "/home/lthpc/anaconda3/envs/babyai/lib/python3.7/site-packages/gym/wrappers/env_checker.py", line 47, in reset
    return passive_env_reset_check(self.env, **kwargs)
  File "/home/lthpc/anaconda3/envs/babyai/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 247, in passive_env_reset_check
    _check_obs(obs, env.observation_space, "reset")
  File "/home/lthpc/anaconda3/envs/babyai/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 115, in _check_obs
    ), f"{pre} is not contained with the observation space ({observation_space})"
AssertionError: The observation returned by the `reset()` method is not contained with the observation space (Dict(image: Box(0, 255, (7, 7, 3), uint8)))

I somehow fixed this by downgrading gym to 0.10.9, but I wonder if the versions of gym and gym-minigrid may affect the environment. Also, the latest version of gym-minigrid no longer supports python 3.6, which was specified in environment.yaml. So can you specify the gym and gym-minigrid versions you used for producing your results? Thanks a lot!

Impossible missions are sampled?

GoToLocal seems to not be working.

image

There is no yellow box in the env?

Code to reproduce:

import ipdb
import babyai.levels.iclr19_levels as iclr19_levels

def main():
    import argparse
    parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('--level', help='BabyAI level', default='GoToLocal')
    parser.add_argument('--num-missions', help='# of unique missions', default=10)
    args = parser.parse_args()

    env_class = getattr(iclr19_levels, "Level_%s" % args.level)
    env = env_class()


    for mission_indx in range(args.num_missions):
        env.seed(mission_indx)
        obs = env.reset()
        env.render()
        ipdb.set_trace()

if __name__ == "__main__":
    main()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.