基于点云数据的 3D 目标检测,还是比较有意思的。
0. 环境配置
# 搭建 Anaconda 环境
# 初始化环境
conda create -n torch python=3.6
# Dependencies
## pytorch
## opencv
### 注意在 Python 2 下可以直接用下面命令
conda install opencv
### 但是在 Python 3 下需要这样的命令:
conda install -c https://conda.binstar.org/menpo opencv3
### or
conda install -c menpo opencv3
## shapely
conda install -c conda-forge shapely
## mayavi
conda install -c anaconda mayavi
spconv
的安装麻烦一些:
- 去仓库下载对应文件:
git clone xxx.git --recursive
- 下载 boost 头文件:
sudo apt-get install libboostall-dev
- 下载 cmake >= 3.13.2
- 然后在 spconv 根目录下运行:
python setup.py bdist_wheel
- 最后打开生成的 dist 文件夹,
pip install xxx.whl
安装时出现了一些问题,可以参考 Pytorch 博文。
mmdet
的安装如下:
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install "git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI"
pip install -v -e . # or "python setup.py develop"
# 训练模型,发现缺少 kitti_dbinfos_train.pkl
python3 tools/train.py ./configs/car_cfg.py
# 在 python3 tools/create_data.py 中修改 main 函数中:
# create_groundtruth_database(data_path= path+ 'KITTI',\
# info_path= path+ 'KITTI/kitti_infos_trainval.pkl',\
# db_info_save_path= path+ 'KITTI/kitti_dbinfos_trainval.pkl')
create_groundtruth_database(data_path= path+ 'KITTI',\
info_path= path+ 'KITTI/kitti_infos_trainval.pkl')
CUDA kernel failed : invalid device function
Segmentation fault (core dumped)
# -gencode=arch=compute_75,code=sm_75
# 忘记怎么解决的了……
RuntimeError: CUDA error: out of memory
Segmentation fault (core dumped)
# 修改了可见的 GPU 发现还是不行