Imitation Learning for Autonomous Driving in CARLA

carla-imitation-learning

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

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

https://github.com/carla-simulator/carla

Imitation Learning for Autonomous Driving in CARLA

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

https://github.com/carla-simulator/imitation-learning

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.
The following repository is another implementation of imitative learning, including training code, but it is incompatible with the model of the above repository and contains no code to execute the benchmark.

https://github.com/mvpcom/carlaILTrainer

Setup CARLA Server

In the following article, we used the Docker image.

Autonomous Driving Simulator CARLA using Docker

In this article, we will use the compiled version downloaded from here (https://github.com/carla-simulator/carla/releases) 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 https://github.com/carla-simulator/imitation-learning

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
$ ./CarlaUE4.sh /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 run_CIL.py

Summary

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