Kaggle Lyft Motion Prediction for Autonomous Vehicles 4th place solution

Overview

Lyft Motion Prediction for Autonomous Vehicles

Code for the 4th place solution of Lyft Motion Prediction for Autonomous Vehicles on Kaggle.

Directory structure

input               --- Please locate data here
src
|-ensemble          --- For 4. Ensemble scripts
|-lib               --- Library codes
|-modeling          --- For 1. training, 2. prediction and 3. evaluation scripts
  |-results         --- Training, prediction and evaluation results will be stored here
README.md           --- This instruction file
requirements.txt    --- For python library versions

Hardware (The following specs were used to create the original solution)

  • Ubuntu 18.04 LTS
  • 32 CPUs
  • 128GB RAM
  • 8 x NVIDIA Tesla V100 GPUs

Software (python packages are detailed separately in requirements.txt):

Python 3.8.5 CUDA 10.1.243 cuddn 7.6.5 nvidia drivers v.55.23.0 -- Equivalent Dockerfile for the GPU installs: Use nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 as base image

Also, we installed OpenMPI==4.0.4 for running pytorch distributed training.

Python Library

Deep learning framework, base library

  • torch==1.6.0+cu101
  • torchvision==0.7.0
  • l5kit==1.1.0
  • cupy-cuda101==7.0.0
  • pytorch-ignite==0.4.1
  • pytorch-pfn-extras==0.3.1

CNN models

Data processing/augmentation

  • albumentations==0.4.3
  • scikit-learn==0.22.2.post1

We also installed apex https://github.com/nvidia/apex

Please refer requirements.txt for more details.

Environment Variable

We recommend to set following environment variables for better performance.

export MKL_NUM_THREADS=1
export OMP_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1

Data setup

Please download competition data:

For the lyft-motion-prediction-autonomous-vehicles dataset, extract them under input/lyft-motion-prediction-autonomous-vehicles directory.

For the lyft-full-training-set data which only contains train_full.zarr, please place it under input/lyft-motion-prediction-autonomous-vehicles/scenes as follows:

input
|-lyft-motion-prediction-autonomous-vehicles
  |-scenes
    |-train_full.zarr (Place here!)
    |-train.zarr
    |-validate.zarr
    |-test.zarr
    |-... (other data)
  |-... (other data)

Pipeline

Our submission pipeline consists of 1. Training, 2. Prediction, 3. Ensemble.

Training with training/validation dataset

The training script is located under src/modeling.

train_lyft.py is the training script and the training configuration is specified by flags yaml file.

[Note] If you want to run training from scratch, please remove results folder once. The training script tries to resume from results folder when resume_if_possible=True is set.

[Note] For the first time of training, it creates cache for training to run efficiently. This cache creation should be done in single process, so please try with the single GPU training until training loop starts. The cache is directly created under input directory.

Once the cache is created, we can run multi-GPU training using same train_lyft.py script, with mpiexec command.

$ cd src/modeling

# Single GPU training (Please run this for first time, for input data cache creation)
$ python train_lyft.py --yaml_filepath ./flags/20201104_cosine_aug.yaml

# Multi GPU training (-n 8 for 8 GPU training)
$ mpiexec -x MASTER_ADDR=localhost -x MASTER_PORT=8899 -n 8 \
  python train_lyft.py --yaml_filepath ./flags/20201104_cosine_aug.yaml

We have trained 9 different models for final submission. Each training configuration can be found in src/modeling/flags, and the training results are located in src/modeling/results.

Prediction for test dataset

predict_lyft.py under src/modeling executes the prediction for test data.

Specify out as trained directory, the script uses trained model of this directory to inference. Please set --convert_world_from_agent true after l5kit==1.1.0.

$ cd src/modeling
$ python predict_lyft.py --out results/20201104_cosine_aug --use_ema true --convert_world_from_agent true

Predicted results are stored under out directory. For example, results/20201104_cosine_aug/prediction_ema/submission.csv is created with above setting.

We executed this prediction for all 9 trained models. We can submit this submission.csv file as the single model prediction.

(Optional) Evaluation with validation dataset

eval_lyft.py under src/modeling executes the evaluation for validation data (chopped data).

python eval_lyft.py --out results/20201104_cosine_aug --use_ema true

The script shows validation error, which is useful for local evaluation of model performance.

Ensemble

Finally all trained models' predictions are ensembled using GMM fitting.

The ensemble script is located under src/ensemble.

# Please execute from root of this repository.
$ python src/ensemble/ensemble_test.py --yaml_filepath src/ensemble/flags/20201126_ensemble.yaml

The location of final ensembled submission.csv is specified in the yaml file. You can submit this submission.csv by uploading it as dataset, and submit via Kaggle kernel. Please follow Save your time, submit without kernel inference for the submission procedure.

You might also like...
Range Image-based LiDAR Localization for Autonomous Vehicles Using Mesh Maps
Range Image-based LiDAR Localization for Autonomous Vehicles Using Mesh Maps

Range Image-based 3D LiDAR Localization This repo contains the code for our ICRA2021 paper: Range Image-based LiDAR Localization for Autonomous Vehicl

Local trajectory planner based on a multilayer graph framework for autonomous race vehicles.
Local trajectory planner based on a multilayer graph framework for autonomous race vehicles.

Graph-Based Local Trajectory Planner The graph-based local trajectory planner is python-based and comes with open interfaces as well as debug, visuali

GndNet: Fast ground plane estimation and point cloud segmentation for autonomous vehicles using deep neural networks.
GndNet: Fast ground plane estimation and point cloud segmentation for autonomous vehicles using deep neural networks.

GndNet: Fast Ground plane Estimation and Point Cloud Segmentation for Autonomous Vehicles. Authors: Anshul Paigwar, Ozgur Erkent, David Sierra Gonzale

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research

Welcome to AirSim AirSim is a simulator for drones, cars and more, built on Unreal Engine (we now also have an experimental Unity release). It is open

[arXiv] What-If Motion Prediction for Autonomous Driving โ“๐Ÿš—๐Ÿ’จ
[arXiv] What-If Motion Prediction for Autonomous Driving โ“๐Ÿš—๐Ÿ’จ

WIMP - What If Motion Predictor Reference PyTorch Implementation for What If Motion Prediction [PDF] [Dynamic Visualizations] Setup Requirements The W

Xview3 solution - XView3 challenge, 2nd place solution
Xview3 solution - XView3 challenge, 2nd place solution

Xview3, 2nd place solution https://iuu.xview.us/ test split aggregate score publ

Transformer part of 12th place solution in Riiid! Answer Correctness Prediction

kaggle_riiid Transformer part of 12th place solution in Riiid! Answer Correctness Prediction. Please see here for more information. Execution You need

Winning solution of the Indoor Location & Navigation Kaggle competition
Winning solution of the Indoor Location & Navigation Kaggle competition

This repository contains the code to generate the winning solution of the Kaggle competition on indoor location and navigation organized by Microsoft

Solution of Kaggle competition: Sartorius - Cell Instance Segmentation

Sartorius - Cell Instance Segmentation https://www.kaggle.com/c/sartorius-cell-instance-segmentation Environment setup Build docker image bash .dev_sc

Comments
  • Suggest to loosen the dependency on albumentations

    Suggest to loosen the dependency on albumentations

    Dear developers,

    Your project kaggle-lyft-motion-prediction-4th-place-solution requires "albumentations==0.4.3" in its dependency. After analyzing the source code, we found that the following versions of albumentations can also be suitable without affecting your project, i.e., albumentations 0.4.0, 0.4.1, 0.4.2, 0.4.4, 0.4.5. Therefore, we suggest to loosen the dependency on albumentations from "albumentations==0.4.3" to "albumentations>=0.4.0,<=0.4.5" to avoid any possible conflict for importing more packages or for downstream projects that may use ddos_script.

    May I pull a request to further loosen the dependency on albumentations?

    By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?



    Details:

    Your project (commit id: 0bc51075db31a747eeebb7f4775a3cd26ad5f870) directly uses 6 APIs from package albumentations.

    albumentations.augmentations.transforms.Cutout.__init__, albumentations.augmentations.transforms.Downscale.__init__, albumentations.augmentations.functional.cutout, albumentations.augmentations.transforms.Blur.__init__, albumentations.core.transforms_interface.ImageOnlyTransform.__init__, albumentations.core.composition.Compose.__init__
    

    Beginning fromwhich, 12 functions are then indirectly called, including 11 albumentations's internal APIs and 1 outsider APIs as follows:

    [/pfnet-research/kaggle-lyft-motion-prediction-4th-place-solution]
    +--albumentations.augmentations.transforms.Cutout.__init__
    |      +--albumentations.core.transforms_interface.BasicTransform.__init__
    |      +--warnings.warn
    +--albumentations.augmentations.transforms.Downscale.__init__
    |      +--albumentations.core.transforms_interface.BasicTransform.__init__
    +--albumentations.augmentations.functional.cutout
    +--albumentations.augmentations.transforms.Blur.__init__
    |      +--albumentations.core.transforms_interface.BasicTransform.__init__
    |      +--albumentations.core.transforms_interface.to_tuple
    +--albumentations.core.transforms_interface.ImageOnlyTransform.__init__
    |      +--albumentations.core.transforms_interface.BasicTransform.__init__
    +--albumentations.core.composition.Compose.__init__
    |      +--albumentations.core.composition.BaseCompose.__init__
    |      |      +--albumentations.core.composition.Transforms.__init__
    |      |      |      +--albumentations.core.composition.Transforms._find_dual_start_end
    |      |      |      |      +--albumentations.core.composition.Transforms._find_dual_start_end
    |      +--albumentations.augmentations.bbox_utils.BboxProcessor.__init__
    |      |      +--albumentations.core.utils.DataProcessor.__init__
    |      +--albumentations.core.composition.BboxParams.__init__
    |      |      +--albumentations.core.utils.Params.__init__
    |      +--albumentations.augmentations.keypoints_utils.KeypointsProcessor.__init__
    |      |      +--albumentations.core.utils.DataProcessor.__init__
    |      +--albumentations.core.composition.KeypointParams.__init__
    |      |      +--albumentations.core.utils.Params.__init__
    |      +--albumentations.core.composition.BaseCompose.add_targets
    

    Since all these functions have not been changed between any version for package "albumentations" from [0.4.0, 0.4.1, 0.4.2, 0.4.4, 0.4.5] and 0.4.3. Therefore, we believe it is safe to loosen the corresponding dependency.

    opened by Agnes-U 0
Owner
null
BirdCLEF 2021 - Birdcall Identification 4th place solution

BirdCLEF 2021 - Birdcall Identification 4th place solution My solution detail kaggle discussion Inference Notebook (best submission) Environment Use K

tattaka 42 Jan 2, 2023
4th place solution for the SIGIR 2021 challenge.

SIGIR-2021 (Tinkoff.AI) How to start Download train and test data: https://sigir-ecom.github.io/data-task.html Place it under sigir-2021/data/. Run py

Tinkoff.AI 4 Jul 1, 2022
Waymo motion prediction challenge 2021: 3rd place solution

Waymo motion prediction challenge 2021: 3rd place solution ?? Technical report ??๏ธ Presentation ?? Announcement ??Motion Prediction Channel Website ??

null 158 Jan 8, 2023
7th place solution of Human Protein Atlas - Single Cell Classification on Kaggle

kaggle-hpa-2021-7th-place-solution Code for 7th place solution of Human Protein Atlas - Single Cell Classification on Kaggle. A description of the met

null 8 Jul 9, 2021
Kaggle | 9th place (part of) solution for the Bristol-Myers Squibb โ€“ Molecular Translation challenge

Part of the 9th place solution for the Bristol-Myers Squibb โ€“ Molecular Translation challenge translating images containing chemical structures into I

Erdene-Ochir Tuguldur 22 Nov 30, 2022
My 1st place solution at Kaggle Hotel-ID 2021

1st place solution at Kaggle Hotel-ID My 1st place solution at Kaggle Hotel-ID to Combat Human Trafficking 2021. https://www.kaggle.com/c/hotel-id-202

Kohei Ozaki 18 Aug 19, 2022
Kaggle | 9th place single model solution for TGS Salt Identification Challenge

UNet for segmenting salt deposits from seismic images with PyTorch. General We, tugstugi and xuyuan, have participated in the Kaggle competition TGS S

Erdene-Ochir Tuguldur 276 Dec 20, 2022
10th place solution for Google Smartphone Decimeter Challenge at kaggle.

Under refactoring 10th place solution for Google Smartphone Decimeter Challenge at kaggle. Google Smartphone Decimeter Challenge Global Navigation Sat

null 12 Oct 25, 2022
Kaggle G2Net Gravitational Wave Detection : 2nd place solution

Kaggle G2Net Gravitational Wave Detection : 2nd place solution

Hiroshechka Y 33 Dec 26, 2022
atmaCup #11 ใฎ Public 4th / Pricvate 5th Solution ใฎใƒชใƒใ‚ธใƒˆใƒชใงใ™ใ€‚

#11 atmaCup 2021-07-09 ~ 2020-07-21 ใซ่กŒใ‚ใ‚ŒใŸ #11 [ๅˆๅฟƒ่€…ๆญ“่ฟŽ! / ็”ปๅƒ็ทจ] atmaCup ใฎใƒชใƒใ‚ธใƒˆใƒชใงใ™ใ€‚็ตๆžœใฏ Public 4th / Private 5th ใงใ—ใŸใ€‚ ใƒ•ใƒฌใƒผใƒ ใƒฏใƒผใ‚ฏใฏ PyTorch ใงใ€ๅฎŸ่ฃ…ใฏ pytorch-image-m

Tawara 12 Apr 7, 2022