How to Use SPVNAS for Efficient 3D Deep Learning

Sep 10, 2023 | Data Science

Welcome to the world of SPVNAS, a powerful tool designed to optimize 3D deep learning architectures. This guide will take you through the necessary steps to get started with SPVNAS, from installation to running models.

Prerequisites

Before diving into the installation process, ensure you have the following libraries ready:

  • Python (versions 3.6 or 3.8)
  • PyTorch (version 1.6)
  • Tqdm
  • Torchpack
  • Torchsparse
  • Numba
  • OpenCV (cv2)

Recommended Installation

Follow these steps for a smooth installation using conda:

conda create -n torch python=3.7
conda activate torch
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
conda install numba opencv
pip install torchpack
pip install --upgrade git+https://github.com/mit-han-lab/torchsparse.git

Data Preparation

Now you need to get the SemanticKITTI dataset:

  1. Visit SemanticKITTI to download the dataset.
  2. Extract all files into dataset/semantic-kitti. You’ll find 22 folders named 00, 01, …, 21 containing velodyne and labels.

Model Zoo

We provide pretrained models in our model zoo, which you can find in the model_zoo.py. Currently, we have models trained on sequences 00-07 and 09-10 evaluated on sequence 08.

Testing Pretrained Models

Here’s how to test with SPVNAS models:

torchpack dist-run -np [num_of_gpus] python evaluate.py configs/semantic_kitti/default.yaml --name [num_of_net]

For example, to test the SemanticKITTI_val_SPVNAS@65GMACs model on one GPU, input:

torchpack dist-run -np 1 python evaluate.py configs/semantic_kitti/default.yaml --name SemanticKITTI_val_SPVNAS@65GMACs

Visualizations

To visualize predictions on a headless server, run:

xvfb-run --server-args=-screen 0 1024x768x24 python visualize.py

If using a computer with a monitor, execute:

python visualize.py

Training Models

Training a model from scratch can be done with:

torchpack dist-run -np [num_of_gpus] python train.py configs/semantic_kitti/[model name][config name].yaml

Example for training SemanticKITTI_val_SPVCNN@30GMACs:

torchpack dist-run -np [num_of_gpus] python train.py configs/semantic_kitti/spvcnn/cr0p5.yaml

For training without MPI on a single GPU, use:

python train.py configs/semantic_kitti/spvcnn/cr0p5.yaml --distributed False

Troubleshooting

If you encounter any issues during installation or running models, consider the following troubleshooting tips:

  • Ensure that all the required libraries are correctly installed and compatible.
  • Double-check your commands for any typos or incorrect parameters.
  • Consult the error logs for specific issues and refer to the relevant documentation.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox