All the codes are tested in the following environment:
- Linux (tested on Ubuntu 14.04/16.04/18.04/20.04/21.04)
- Python 3.6+
- PyTorch 1.1 or higher (tested on PyTorch 1.1, 1,3, 1,5~1.10)
- CUDA 9.0 or higher (PyTorch 1.3+ needs CUDA 9.2+)
spconv v1.x
orspconv v2.x
Notice that all results in the paper is running in with Spconv 1.2.1, but the flops calculation for spconv-based network (i.e. CenterPoint-Voxel or SECOND) is running with Spconv 2.x.
NOTE: Please re-install pcdet v0.5.2
by running python setup.py develop
even if you have already installed previous version.
a. Clone this repository.
git clone https://github.com/jihanyang/SparseKD.git
b. Install the dependent libraries as follows:
- Install the dependent python libraries:
pip install -r requirements.txt
- Install the SparseConv library, we use the implementation from
[spconv]
.- If you use PyTorch 1.1, then make sure you install the
spconv v1.0
with (commit 8da6f96) instead of the latest one. - If you use PyTorch 1.3+, then you need to install the
spconv v1.2.1
. As mentioned by the author ofspconv
, you need to use their docker if you use PyTorch 1.4+. - You could also install latest
spconv v2.x
with pip, see the official documents of spconv.
- If you use PyTorch 1.1, then make sure you install the
c. Install this pcdet
library and its dependent libraries by running the following command:
python setup.py develop
(If you don't need to calculate Flops, Parameters and Acts, just skip this part) To calculate Flops and Acts, we leverage the popular pytorch-OpCounter.
Note: that the Flops in our paper actually means Macs in pytorch-OpCounter.
We use the term Flops
in order to follow the same formulation as RegNetX, we name it as flops in
the paper.
a. Clone our customized Thop.
git clone https://github.com/jihanyang/pytorch-OpCounter.git
b. Install.
cd pytorch-OpCounter && pip install .