原作者地址:https://github.com/tianweiy/CenterPoint
配置过程主要参考CenterPoint/docs/INSTALL.md
在conda中配置虚拟环境
# basic python libraries
conda create --name centerpoint python=3.6
conda activate centerpoint
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
git clone https://github.com/tianweiy/CenterPoint.git
cd CenterPoint
pip install -r requirements.txt
# add CenterPoint to PYTHONPATH by adding the following line to ~/.bashrc (change the path accordingly)
export PYTHONPATH="${PYTHONPATH}:PATH_TO_CENTERPOINT"
nuScenes dev-kit
git clone https://github.com/tianweiy/nuscenes-devkit
# add the following line to ~/.bashrc and reactivate bash (remember to change the PATH_TO_NUSCENES_DEVKIT value)
export PYTHONPATH="${PYTHONPATH}:PATH_TO_NUSCENES_DEVKIT/python-sdk"
Cuda Extensions(更新到自己的版本比如11.3)
# set the cuda path(change the path to your own cuda location)
export PATH=/usr/local/cuda-11.3/bin:$PATH
export CUDA_PATH=/usr/local/cuda-11.3
export CUDA_HOME=/usr/local/cuda-11.3
export LD_LIBRARY_PATH=/usr/local/cuda-11.3/lib64:$LD_LIBRARY_PATH
# Rotated NMS
cd ROOT_DIR/det3d/ops/iou3d_nms
python setup.py build_ext --inplace
# Deformable Convolution (Optional and only works with old torch versions e.g. 1.1)
cd ROOT_DIR/det3d/ops/dcn
python setup.py build_ext --inplace
或者执行 根目录下bash setup.sh
APEX (Optional)
git clone https://github.com/NVIDIA/apex
cd apex
git checkout 5633f6 # recent commit doesn't build in our system
pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
spconv(建议checkout v1.2.1)
sudo apt-get install libboost-all-dev
git clone https://github.com/traveller59/spconv.git --recursive
cd spconv && git checkout 7342772
python setup.py bdist_wheel
cd ./dist && pip install *
- 比如编译时出现cannot import name ‘SparseConv3d’ from ‘spconv’
?解决方案:spconv的third_part里手动git clone pybind11并chekck out到某个版本【版本号:085a29436a8c472caaaf7157aa644b571079bcaa】,然后再重新编译spconv即可。
|