Imitation Learning for Autonomous Driving in CARLA

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

By using imitation learning at CARLA, autonomous driving like the following video can be done.


CARLA (Car Learning to Act) is an open-source simulator based on Unreal Engine 4 for autonomous driving research.

Imitation Learning for Autonomous Driving in CARLA

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

There is a link from the above GitHub to the data set (24GB), but the training code is not included in this repository.
The training code seems to be the following repository.

Setup CARLA Server

In the following article, we used the Docker image.

In this article, we will use the compiled version downloaded from here ( on Ubuntu 16.04 LTS.
For the version of CARLA, use 0.8.2 shown in the requirements (it also worked in 0.8.4).
Extract the CARLA compressed file with the following command.

$ cd
$ mkdir carla-0.8.2
$ tar xf Downloads/CARLA_0.8.2.tar.gz -C carla-0.8.2

Clone imitation-learning Repository

With the following command, clone the imitation-learning repository.

$ cd
$ git clone

Install Dependent Packages

Install Python related dependencies packages.
Since there is no detailed version designation, create a virtual environment carla_il of Python 3.6 using Miniconda, and install tentorflow-gpu (1.8.0, include numpy 1.14.5), scipy (1.1.0), and pillow (5.1.0) using conda.

Execution of the CoRL-2017 Benchmark

In the first terminal, run the following command to start the CARLA server.

$ cd ~/carla-0.8.2
$ ./ /Game/Maps/Town01 -carla-server -benchmark -fps=10 -windowed -ResX=640 -ResY=480

In another terminal, to start the Python client, execute the following command.

$ export PYTHONPATH=~/carla-0.8.2/PythonClient/:$PYTHONPATH
$ source activate carla_il
$ cd ~/imitation-learning
$ python


In this article, we introduced imitation learning for autonomous driving in CARLA.