The 3rd place solution for competition “Lyft Motion Prediction for Autonomous Vehicles” at Kaggle


Team behind this solution:

  1. Artsiom Sanakoyeu [Homepage] [Twitter] [Telegram Channel] [LinkedIn]
  2. Dmytro Poplavskiy [Kaggle] [LinkedIn]
  3. Artsem Zhyvalkouski [Kaggle] [Twitter] [GitHub] [LinkedIn]

Explanation of the solution:

Video: link

Blogpost: link

Brief solution writeup: link

How to reproduce results

  1. [Optional] Set the paths in the configs. But the default paths should work as well.
  1. Install dependencies.
  • pip install -r requirements.txt
  • Apply patch to l5kit with ./ (it disables processing of rasterized images to allow rasterizer to return multiple results).
  1. Download and prepare data.
  1. Train 1st level models.
  1. Run inference of 1st level models on the test set.
    You may need to change which chekpoints to load when predicting (in, as the best epoch may change after you retrain the models.
  1. Train 2nd level model on the predicts of the 1st level models on the test set.
cd src/2nd_level && python

Make sure you’ve set all paths right in 2nd_level/ w.r.t. the 2nd_level directory.

  1. Predict on the test set using the 2nd level model.
cd src/2nd_level && python

The file witn final predictions will be saved to `src/2nd_level/submission.csv’.

Directory structure example (i.e., how it should look like after everything is trained and predicted) is in directory_structure.txt.


  • To skip training the 1st level models, you can download the pretrained weights by running bash
  • To skip training and inference of the 1st level models, you can download all predicts. More details on this are in src/1st_level/submissions.
  • More details on how to use 2nd level model are in src/2nd_level.
  • Our final 2nd level model with 9.404 Private LB score is already committed in this repository (src/2nd_level/transformer.bin). To run inference using this model you can directly execute cd src/2nd_level && python