Imitation Learning Training for CARLA

CARLA is an open-source simulator for autonomous driving research.
In this article, we will introduce imitation learning training for CARLA.

Imitation Learning for Autonomous Driving in CARLA

The following repository has codes and a trained model for executing the driving benchmark (CoRL-2017 benchmark) in CARLA.

There is a link from this repository to the data set (24GB), but training code is not included.

Here, we combine the following repositories with the above data set to build a training environment for imitation learning.

Setup Training Environment for Imitation Learning


  • Ubuntu 16.04 or later
  • Docker
  • NVIDIA Docker 2
  • NVIDIA Driver >= 390

Clone carlaILTrainer Repository

With the following command, clone the carlaILTrainer repository.

$ cd
$ git clone

Setup Dataset

Download the linked data set (24GB) from here (, and expand it with the following command.

$ cd ~/carlaILTrainer
$ tar xf ~/Downloads/CORL2017ImitationLearningData.tar.gz

Exclude data_06790.h5 where an error occurs.

Creating Docker Image

Use the carlaILTrainer repository perfectEnv.yml to create a Docker image.

Although details of Dockerfile are omitted, it is based on nvidia/cuda:8.0-cudnn6-runtime-ubuntu16.04 in order to operate tensorflow-gpu 1.4.1.

Also, after installing miniconda, execute the following command.

# Dockerfile
/path/to/conda env create -f perfectEnv.yml

Use the following command to create a Docker image.

$ docker build -t carla_ilt .

Imitation Learning Training for CARLA

Run Docker

docker run --runtime=nvidia --rm -it -v /home/$USER/carlaILTrainer:/workspace carla_ilt

Imitation Learning Training

# source activate carlaSimPy2
# python

The trained model is saved in the test directory.

After moving the trained model to the imitation-learning directory, we tried python, but an error occurs as written here (


In this article, we introduced imitation learning training for CARLA.