代码链接: https://github.com/PRBonn/lidar-bonnetal
安装anaconda环境为
CUDA 11.0(11.1也可以)
anaconda环境如下
numpy==1.17.2
torchvision==0.2.2
matplotlib==2.2.3
tensorflow==1.13.1
scipy==0.19.1
pytorch==1.7.1
vispy==0.5.3
opencv_python==4.1.0.25
opencv_contrib_python==4.1.0.25
Pillow==6.1.0
PyYAML==5.1.1
修改anaconda,换源
gedit .condarc
更换文件信息
channels:- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free- defaults
show_channel_urls: true
default_channels:- http://mirrors.aliyun.com/anaconda/pkgs/main- http://mirrors.aliyun.com/anaconda/pkgs/r- http://mirrors.aliyun.com/anaconda/pkgs/msys2
custom_channels:conda-forge: http://mirrors.aliyun.com/anaconda/cloudmsys2: http://mirrors.aliyun.com/anaconda/cloudbioconda: http://mirrors.aliyun.com/anaconda/cloudmenpo: http://mirrors.aliyun.com/anaconda/cloudpytorch: http://mirrors.aliyun.com/anaconda/cloudsimpleitk: http://mirrors.aliyun.com/anaconda/cloud
安装指令
conda install numpy==1.17.2 Pillow==6.1.0 PyYAML==5.1.1 matplotlib==2.2.3 vispy==0.5.3其中pytorch、torchvision、torchaudio、一起安装。指令如下conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch
安装和查看python opencv版本 指令
pip install opencv-python==4.1.0.25
pip install opencv-contrib-python==4.1.0.25python
import cv2
cv2.__version__
或者
conda list
下载数据集链接
官方地址:http://www.semantic-kitti.org/dataset.html#overview
其中80G激光雷达数据的链接:https://pan.baidu.com/s/1OjoWrwE8xIrCmYO2hujJNw 提取码:6381
标签数据在官方地址第三个的179M。
参考博客:https://blog.csdn.net/BIT_HXZ/article/details/123539476
将80G的激光雷达数据文件和标签文件放在一起,(只取前10个数据)如下图所示
运行训练指令如下
cd xx/xx/xx/semantic
mkdir log
./train.py -d dataset/ -ac config/arch/darknet21.yaml -l log
运行可能有bug,修改文件 lidar-bonnetal-master/train/tasks/semantic/dataset/kitti/parser.py
将unproj_xyz[:unproj_n_points] = torch.from_numpy(scan.points)
改为unproj_xyz[:unproj_n_points] = torch.Tensor(scan.points)
有好几处
torch.from_numpy改为torch.Tensor