OpenPCDer框架下的PointPillars训练、测试、demo可视化、损失函数

目录

一、基本配置

二、准备工作

1.生成数据信息(pkl文件)

1.1 KITTI

1.2 Waymo

2.激活环境

3.进入tools文件夹下

四、训练

单卡(指定显卡号):

多卡:

五、测试

六、demo结果可视化

七、损失函数 可视化

tensorBoard可视化

打开网址:

一、基本配置

  1.  Ubuntu 22.04.2
  2. CUDA 11.8

二、准备工作

1.生成数据信息(pkl文件)

1.1 KITTI

python -m pcdet.datasets.kitti.kitti_dataset create_kitti_infos tools/cfgs/dataset_configs/kitti_dataset.yaml

1.2 Waymo

后面可能会用,待更新...

2.激活环境

3.进入tools文件夹下

四、训练

单卡(指定显卡号):

CUDA_VISIBLE_DEVICES=2 python train.py --cfg_file ./cfgs/kitti_models/pointpillar.yaml --batch_size 4 --epochs 80

参数:

CUDA_VISIBLE_DEVICES(可选):显卡 号

--cfg_file:模型 配置文件

--batch_size:批处理大小

--epochs:训练周期

多卡:

注:本人 torch版本是2.0.0,下面命令会报错

CUDA_VISIBLE_DEVICES=1,2 python -m torch.distributed.launch --nproc_per_node=2 train.py --cfg_file cfgs/kitti_models/pointpillar.yaml --launcher pytorch

将torch.distributed.launch改为torch.distributed.run即可。

简易版:

CUDA_VISIBLE_DEVICES=1,2 python -m torch.distributed.run --nproc_per_node=2 train.py --cfg_file cfgs/kitti_models/pointpillar.yaml --launcher pytorch

自用版:

一张GPU显卡:

OMP_NUM_THREADS=32 CUDA_VISIBLE_DEVICES=1 python -m torch.distributed.run --nproc_per_node=1 train.py --cfg_file cfgs/kitti_models/pointpillar.yaml --launcher pytorch --batch_size 2 --epochs 80

二张GPU显卡:

OMP_NUM_THREADS=32 CUDA_VISIBLE_DEVICES=1,2 python -m torch.distributed.run --nproc_per_node=2 train.py --cfg_file cfgs/kitti_models/pointpillar.yaml --launcher pytorch --batch_size 2 --epochs 80

三张GPU显卡:

OMP_NUM_THREADS=32 CUDA_VISIBLE_DEVICES=0,1,2 python -m torch.distributed.run --nproc_per_node=3 train.py --cfg_file cfgs/kitti_models/pointpillar.yaml --launcher pytorch --batch_size 2 --epochs 80

需要改的参数:

可选:OMP_NUM_THREADS、CUDA_VISIBLE_DEVICES

修改:--batch_size、--epochs

五、测试

CUDA_VISIBLE_DEVICES=1 python test.py --cfg_file ./cfgs/kitti_models/pointpillar.yaml --batch_size 64 --ckpt ../output/cfgs/kitti_models/pointpillar/default/ckpt/latest_model.pth --eval_all

新参数:

--eval_all 

疑惑:

--eval_tag mAP (不太懂)

python test.py --cfg_file ./cfgs/kitti_models/pointpillar.yaml --batch_size 4 --ckpt pointpillar1.pth --eval_tag mAP

六、demo结果可视化

python demo.py --cfg_file cfgs/kitti_models/pointpillar.yaml --ckpt pointpillar.pth --data_path 000099.bin
参数说明文件类型

--cfg_file

跟 模型配置文件

.yaml

--data_path

跟 要可视化的点云数据(测试集)

.bin

--ckpt

跟 训练的模型的路径

.pth

自用 (使用mayavi库可视化)

python mayavi_demo.py --cfg_file cfgs/kitti_models/pointpillar.yaml --ckpt pointpillar1.pth --data_path 000099.bin

编写了一个 mayavi_demo.py 

七、损失函数 可视化

tensorBoard可视化

安装tensorboard

pip install tensorboard

输入

tensorboard --logdir=../output/cfgs/kitti_models/pointpillar/default/tensorboard --bind_all

参数:

--bind_all

打开网址:

http://server_ip:6006

粗略写的,后面完善。

  • 12
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要复现OpenPCDet中的PointPillars算法,可以按照以下步骤进行操作: 1. 首先,克隆OpenPCDet的GitHub仓库到本地。可以使用以下命令进行克隆: ``` git clone https://github.com/open-mmlab/OpenPCDet.git ``` 2. 进入克隆好的OpenPCDet目录,并安装所需的Python依赖。可以使用以下命令安装依赖: ``` cd OpenPCDet pip install -r requirements.txt ``` 3. 下载PointPillars的源代码和相关环境包。可以使用以下命令进行下载: ``` mkdir -p ~/pointpillars_ros/src cd ~/pointpillars_ros/src git clone https://github.com/BIT-DYN/pointpillars_ros ``` 4. 将OpenPCDet工程中的OpenPCDet/tools目录下的全部文件以及/OpenPCDet/pcdet目录下的文件复制到~/pointpillars_ros/src/pointpillars_ros/tools目录下。确保将所有文件都复制过去,尤其要注意不要遗漏pcdet文件夹。 5. 进入~/pointpillars_ros目录,并激活OpenPCDet的环境。可以使用以下命令进行激活: ``` cd ~/pointpillars_ros conda activate pcdet ``` 6. 安装所需的ROS依赖。可以使用以下命令进行安装: ``` pip install --user rospkg catkin_pkg sudo apt-get install ros-noetic-pcl-ros sudo apt-get install ros-noetic-jsk-recognition-msg sudo apt-get install ros-noetic-jsk-rviz-plugins ``` 7. 完成上述步骤后,即可开始复现PointPillars算法。可以使用以下命令启动PointPillars: ``` source ~/pointpillars_ros/devel/setup.bash roslaunch pointpillars_ros pointpillars.launch ``` 请注意,以上步骤仅为大致指导,具体操作可能因环境和配置而有所不同。建议参考OpenPCDet和PointPillars的官方文档以获取更详细的指导。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值