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.

PyBrain - Another Python Machine Learning Library.

PyBrain -- the Python Machine Learning Library =============================================== INSTALLATION ------------ Quick answer: make sure you

2.8k Dec 31, 2022
DyStyle: Dynamic Neural Network for Multi-Attribute-Conditioned Style Editing

DyStyle: Dynamic Neural Network for Multi-Attribute-Conditioned Style Editing Figure: Joint multi-attribute edits using DyStyle model. Great diversity

74 Dec 03, 2022
TensorFlow implementation of "TokenLearner: What Can 8 Learned Tokens Do for Images and Videos?"

TokenLearner: What Can 8 Learned Tokens Do for Images and Videos? Source: Improving Vision Transformer Efficiency and Accuracy by Learning to Tokenize

Aritra Roy Gosthipaty 23 Dec 24, 2022
Distributing reference energies for SMIRNOFF implementations

Warning: This code is currently experimental and under active development. Is it not yet suitable for distribution or use as reference implementation.

Open Force Field Initiative 1 Dec 07, 2021
The missing CMake project initializer

cmake-init - The missing CMake project initializer Opinionated CMake project initializer to generate CMake projects that are FetchContent ready, separ

1k Jan 01, 2023
Automate issue discovery for your projects against Lightning nightly and releases.

Automated Testing for Lightning EcoSystem Projects Automate issue discovery for your projects against Lightning nightly and releases. You get CPUs, Mu

Pytorch Lightning 41 Dec 24, 2022
Facial recognition project

Facial recognition project documentation Project introduction This project is developed by linuxu. It is a face model recognition project developed ba

Jefferson 2 Dec 04, 2022
[ICCV' 21] "Unsupervised Point Cloud Pre-training via Occlusion Completion"

OcCo: Unsupervised Point Cloud Pre-training via Occlusion Completion This repository is the official implementation of paper: "Unsupervised Point Clou

Hanchen 204 Dec 24, 2022
Semi-supervised Transfer Learning for Image Rain Removal. In CVPR 2019.

Semi-supervised Transfer Learning for Image Rain Removal This package contains the Python implementation of "Semi-supervised Transfer Learning for Ima

Wei Wei 59 Dec 26, 2022
This repository contains the code for designing risk bounded motion plans for car-like robot using Carla Simulator.

Nonlinear Risk Bounded Robot Motion Planning This code simulates the bicycle dynamics of car by steering it on the road by avoiding another static car

8 Sep 03, 2022
A PyTorch implementation of "SelfGNN: Self-supervised Graph Neural Networks without explicit negative sampling"

SelfGNN A PyTorch implementation of "SelfGNN: Self-supervised Graph Neural Networks without explicit negative sampling" paper, which will appear in Th

Zekarias Tilahun 24 Jun 21, 2022
Pytorch Code for "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation"

Medical-Transformer Pytorch Code for the paper "Medical Transformer: Gated Axial-Attention for Medical Image Segmentation" About this repo: This repo

Jeya Maria Jose 615 Dec 25, 2022
An implementation of Equivariant e2 convolutional kernals into a convolutional self attention network, applied to radio astronomy data.

EquivariantSelfAttention An implementation of Equivariant e2 convolutional kernals into a convolutional self attention network, applied to radio astro

2 Nov 09, 2021
Experiments for distributed optimization algorithms

Network-Distributed Algorithm Experiments -- This repository contains a set of optimization algorithms and objective functions, and all code needed to

Boyue Li 40 Dec 04, 2022
image scene graph generation benchmark

Scene Graph Benchmark in PyTorch 1.7 This project is based on maskrcnn-benchmark Highlights Upgrad to pytorch 1.7 Multi-GPU training and inference Bat

Microsoft 303 Dec 27, 2022
ViSD4SA, a Vietnamese Span Detection for Aspect-based sentiment analysis dataset

UIT-ViSD4SA PACLIC 35 General Introduction This repository contains the data of the paper: Span Detection for Vietnamese Aspect-Based Sentiment Analys

Nguyễn Thị Thanh Kim 5 Nov 13, 2022
Mae segmentation - Reproduction of semantic segmentation using masked autoencoder (mae)

ADE20k Semantic segmentation with MAE Getting started Install the mmsegmentation

97 Dec 17, 2022
Unofficial implementation of Alias-Free Generative Adversarial Networks. (https://arxiv.org/abs/2106.12423) in PyTorch

alias-free-gan-pytorch Unofficial implementation of Alias-Free Generative Adversarial Networks. (https://arxiv.org/abs/2106.12423) This implementation

Kim Seonghyeon 502 Jan 03, 2023
YolactEdge: Real-time Instance Segmentation on the Edge

YolactEdge, the first competitive instance segmentation approach that runs on small edge devices at real-time speeds. Specifically, YolactEdge runs at up to 30.8 FPS on a Jetson AGX Xavier (and 172.7

Haotian Liu 1.1k Jan 06, 2023
STRIVE: Scene Text Replacement In Videos

STRIVE: Scene Text Replacement In Videos Dataset Types: RoboText SynthText RealWorld videos RoboText : Videos of texts collected using navigation robo

15 Jul 11, 2022