Getting Started
September 24, 2022 ยท View on GitHub
The dataset configs are located within tools/cfgs/dataset_configs, and the model configs are located within tools/cfgs for different datasets.
Dataset Preparation
Please follow the OpenPCDet tutorial to prepare needed datasets.
Training & Testing
Step 1: Train a teacher model (CP-Pillar as example)
sh scripts/dist_train.sh ${NUM_GPUS} --cfg_file cfgs/waymo_models/cp-pillar/cp-pillar.yaml
Step 2: Distillation (CP-Pillar-v0.4 as example)
Modify following keys in the student distillation config
# cfgs/waymo_models/cp-pillar/cp-pillar-v0.4_sparsekd.yaml
TEACHER_CKPT: ${PATH_TO_TEACHER_CKPT}
PRETRAINED_MODEL: ${PATH_TO_TEACHER_CKPT}
Run the training config
sh scripts/dist_train.sh ${NUM_GPUS} --cfg_file cfgs/waymo_models/cp-pillar/cp-pillar-v0.4_sparsekd.yaml
Calculate Efficiency Metrics
Prepare
Make sure you have installed our customized Thop as INSTALL.md.
To calculate the Flops and Acts for spconv-based models, you also need to replace original conv.py in spconv
with our modified one.
# replace our modified conv file for
# make sure your spconv is at least 2.1.20
cp extra_files/conv.py ${CONDA_PATH}/envs/${ENV_NAME}/lib/${PYTHON_VERSION}/site-packages/spconv/pytorch/
Command
# Take Waymo as an example
# This command have to be executed on single gpu only
python test.py --cfg_file ${CONFIG_PATH} --batch_size 1 --ckpt ${CKPT_PATH} --infer_time --cal_params \
--set DATA_CONFIG.DATA_SPLIT.test infer_time DATA_CONFIG.SAMPLED_INTERAVL.test 2