TopoLiDM: Topology-Aware LiDAR Diffusion Models for Interpretable and Realistic LiDAR Point Cloud Generation
Jiuming Liu†1, Zheng Huang†1, Mengmeng Liu2, Tianchen Deng1, Francesco Nex2, Hao Cheng2, Hesheng Wang*1
1Shanghai Jiao Tong University |
2University of Twente
†Equal contribution | *Corresponding author
Note: Run the following commands one by one rather than as a single script, as some steps (e.g. conda activate) require shell re-sourcing.
# Optional: set Tsinghua mirror for faster downloads in China
export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
export RUSTUP_UPDATE_ROOT=https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"conda create -n ld python=3.10.11 -y
conda activate ldpip install --upgrade pip
pip install setuptools==69.5.1
pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 \
--index-url https://download.pytorch.org/whl/cu118pip install \
torchmetrics==0.5.0 pytorch-lightning==1.4.2 omegaconf==2.1.1 \
einops==0.3.0 transformers==4.36.2 imageio==2.9.0 imageio-ffmpeg==0.4.2 \
opencv-python kornia==0.7.0 wandb more_itertools gdown \
numpy==1.26 easydict joblib scipy
pip install -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
pip install -e git+https://github.com/openai/CLIP.git@main#egg=clippip install -e git+https://github.com/bruel-gabrielsson/TopologyLayer.git --no-build-isolation
apt-get update && apt-get install -y libboost-all-dev
conda install -c conda-forge dionysusAfter installing TopologyLayer, patch a NumPy API deprecation inside the library:
# Replace deprecated np.int with int throughout TopologyLayer source
cd path/to/TopologyLayer # typically inside your pip src/ folder
grep -rl "np.int" . | xargs sed -i 's/np.int/int/g'apt-get install -y libsparsehash-dev
# Clear LD_LIBRARY_PATH to avoid library conflicts (see Troubleshooting below)
LD_LIBRARY_PATH="" pip install git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0 \
--no-build-isolationmkdir -p dataset/ # symlink or place KITTI-360 data here
mkdir -p pretrained_weights/ # place pretrained model checkpoints hereSee lidm/eval/README.md for details on preparing evaluation checkpoints. If a checkpoint is a .zip file, remove the .zip suffix before use.
We release pretrained weights on Hugging Face: hhzz0505/TopoLiDM
| Model | Description | File |
|---|---|---|
| Topological Autoencoder | Trained on KITTI-360 | autoencoder/model.ckpt |
| Diffusion Model | Unconditional LiDAR generation on KITTI-360 | diffusion/model.ckpt |
Download with Python:
from huggingface_hub import hf_hub_download
# Autoencoder
hf_hub_download(repo_id="hhzz0505/TopoLiDM", filename="autoencoder/model.ckpt", local_dir="pretrained_weights/")
# Diffusion model
hf_hub_download(repo_id="hhzz0505/TopoLiDM", filename="diffusion/model.ckpt", local_dir="pretrained_weights/")Or via CLI:
huggingface-cli download hhzz0505/TopoLiDM --local-dir pretrained_weights/# Train on KITTI with topological regularization (multi-GPU)
python main.py -b configs/autoencoder/kitti/autoencoder_c2_p4_topo.yaml -t --gpus 0,1,2,3
# Resume from a checkpoint (note: -n and -r are mutually exclusive)
python main.py -b configs/autoencoder/kitti/autoencoder_c2_p4_topo.yaml -t --gpus 0 \
-r path/to/checkpoint
# Single-GPU debug mode
python main.py -b configs/autoencoder/kitti/autoencoder_c2_p4_topo.yaml -t --gpus 0 -dCUDA_VISIBLE_DEVICES=0 python scripts/sample.py \
-d kitti -r models/lidm/kitti/uncond/model.ckpt -n 2000 --evaltopolidm/
├── main.py # Main training entry point
├── configs/
│ └── autoencoder/kitti/
│ └── autoencoder_c2_p4_topo.yaml # Topological autoencoder config
├── lidm/
│ ├── models/
│ │ ├── autoencoder.py # Standard LiDM autoencoder
│ │ └── autoencoder_topo.py # Topological autoencoder
│ └── modules/diffusion/
│ ├── model_lidm.py # LiDM UNet components
│ └── model_topolidm.py # Graph encoder + decoder
Two errors are commonly encountered when installing torchsparse in a conda environment.
ImportError: /opt/hpcx/ucc/lib/libucc.so.1: undefined symbol: ucs_config_doc_nop
Cause: The system-level LD_LIBRARY_PATH includes /opt/hpcx/ucc/lib/, whose libucc.so.1 conflicts with the library expected by PyTorch. Python loads the system library instead of the conda environment's library at startup.
Fix:
# Clear LD_LIBRARY_PATH before running pip
LD_LIBRARY_PATH="" pip install git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0 \
--no-build-isolation
# Alternative: use env -i to fully isolate the subprocess environment
env -i PATH="$PATH" HOME="$HOME" pip install \
git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0 --no-build-isolationRuntimeError: The detected CUDA version (12.4) mismatches the version that was used
to compile PyTorch (11.8).
Cause: The nvcc visible to pip comes from a different CUDA toolkit than the one used to build the installed PyTorch. PyTorch's cpp_extension.py checks for this mismatch.
Fix: Reinstall PyTorch pinned to your system's CUDA version, then reinstall torchsparse:
pip uninstall -y torch
pip install --no-cache-dir torch==2.0.1+cu118 --index-url https://download.pytorch.org/whl/cu118
LD_LIBRARY_PATH="" pip install git+https://github.com/mit-han-lab/torchsparse.git@v1.4.0 \
--no-build-isolationThe underlying problem is that conda's environment variables (set via conda env config vars set) only take effect when conda explicitly activates the environment in the current shell. A LD_LIBRARY_PATH set in ~/.bashrc or by a system init script takes precedence over conda's settings in any shell that inherits it without re-activating conda.
Diagnosis commands:
# Check which library paths are currently active
echo $LD_LIBRARY_PATH
# Check that PyTorch is loading from the right place
unset LD_LIBRARY_PATH && python -c "import torch; print(torch.__version__, torch.version.cuda)"
# Verify torchsparse after a clean install
unset LD_LIBRARY_PATH && python -c "import torchsparse; print(torchsparse.__version__)"| Error | Cause | Fix |
|---|---|---|
undefined symbol: ucs_config_doc_nop |
LD_LIBRARY_PATH points to wrong libucc |
Run with LD_LIBRARY_PATH="" |
CUDA version mismatch |
nvcc version differs from PyTorch's CUDA |
Reinstall matching PyTorch version |
Unknown CUDA arch (8.7) |
GPU arch not supported by this build | Set TORCH_CUDA_ARCH_LIST="8.0;8.6" |
No module named 'pkg_resources' |
New setuptools removed pkg_resources |
pip install setuptools==69.5.1 |
libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent |
PyTorch version conflicts with system libs | Reinstall CUDA-matched PyTorch |
If you find this work useful, please cite our paper:
@inproceedings{liu2025topolidm,
title={TopoLiDM: Topology-Aware LiDAR Diffusion Models for Interpretable and Realistic LiDAR Point Cloud Generation},
author={Liu, Jiuming and Huang, Zheng and Liu, Mengmeng and Deng, Tianchen and Nex, Francesco and Cheng, Hao and Wang, Hesheng},
booktitle={2025 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
pages={8180--8186},
year={2025},
organization={IEEE}
}- The diffusion model framework builds heavily on Latent Diffusion
- Topological regularization concepts from GLiDR
- LiDAR data processing pipeline from LiDM