This repository contains three components: an improved version of ILSwiss, which is an RL training suite containing the implementation of Generative Adversarial Imitation Learning (GAIL), and two environments. The two environments both are driving simulators that use NGSIM I-80 dataset as background traffic. One of them is PPUU, the other is implemented as an imitation learning scenario based on SMARTS platform.
-
Clone this repository
-
Install python requirements with
pip install -r requirements.txt
-
Download the SMARTS platform as a submodule with
git submodule init git submodule update
-
Install SMARTS simulation platform in the
./SMARTS
folder following its instructionscd ./SMARTS bash ./utils/setup/install_deps.sh echo "export SUMO_HOME=/usr/share/sumo" >> ~/.bashrc pip install -e .[camera-obs]
-
Download the NGSIM dataset from: https://drive.google.com/file/d/1SILBfK2Z1LiTJ9cc4qGErq547Ax5nX8M/view?usp=share_link, and place it under
smarts-imitation/
-
Install the ngsim wrapper for smarts with
pip install -e ./smarts-imitation # You may encounter the ModuleNotFoundError when running this command, # which is okay. Please just wait until it terminates. scl scenario build --clean ./smarts-imitation/ngsim
-
Generate structured expert demonstrations with
cd ILSwiss python run_experiment.py -e exp_specs/gen_expert/smarts.yaml
-
Run GAIL with
python run_experiment.py -e exp_specs/gail/gail_smarts.yaml
-
Make sure you have downloaded the NGSIM dataset and placed it under
smarts-imitation
. Create a link to the dataset under PPUU folder:mkdir pytorch-PPUU/traffic-data ln -s $(pwd)/smarts-imitation/xy-trajectories pytorch-PPUU/traffic-data/
Process the traffic data to dump the "state, action, cost" triple:
cd pytorch-PPUU for t in 0 1 2; do python generate_trajectories.py -map i80 -time_slot $t; done
-
Generate structured expert demonstrations with
python run_experiment.py -e exp_specs/gen_expert/ppuu.yaml
-
Run GAIL with
python run_experiment.py -e exp_specs/gail/gail_pppu.yaml