Need help with babyai?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

515 Stars 101 Forks BSD 3-Clause "New" or "Revised" License 1.3K Commits 2 Opened issues


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

Services available


Need anything else?

Contributors list

BabyAI 1.1

Build Status

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:

    title={BabyAI 1.1},
    author={David Yu-Tung Hui and Maxime Chevalier-Boisvert and Dzmitry Bahdanau and Yoshua Bengio},

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

  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},

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


Conda (Recommended)

If you are using conda, you can create a

environment with all the dependencies by running:
git clone
cd babyai
conda env create -f environment.yaml
source activate babyai

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

cd ..
git clone
cd gym-minigrid
pip install --editable .

The last command installs the repository in editable mode. Move back to the

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

git clone
cd babyai
pip3 install --editable .

Finally, follow these instructions

BabyAI Storage Path

Add this line to

(Linux), or
export BABYAI_STORAGE='/////'


is the folder where you typed
git clone

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


Downloading the demos

These can be downloaded here

Ensure the downloaded file has the following md5 checksum (obtained via


before extraction:

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

Using the

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


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

. 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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.