赞
踩
环境:Ubuntu20.04+jetpack5.0.2+python3.8
CUDA11.4+cuDNN8.4.1.50
torch1.13
参考:NVIDIA Jetson AGX Orin配置OpenPCDet环境部署PointPillar
参考:NVIDIA Jetson AGX Xavier安装OpenPCDet完整踩坑记录_Popuffu的博客-CSDN博客
github下载对应版本后使用setup.py编译轮子,再用pip安装轮子,注意声明环境参数,在安装前运行
export CUMM_CUDA_VERSION="11.4" # 11.4为cuda版本
export CUMM_DISABLE_JIT="1" # 不用JIT编译cumm,而是编译成whl后再安装
export CUMM_CUDA_ARCH_LIST="8.7" # xavier是7.2,TX2是6.2,orin是8.7
我选择的是cumm-cu114 0.4.11和spconv-cu114 2.3.6
GitHub - FindDefinition/cumm: CUda Matrix Multiply library
GitHub - traveller59/spconv: Spatial Sparse Convolution Library
同样参考:NVIDIA Jetson AGX Xavier安装OpenPCDet完整踩坑记录_Popuffu的博客-CSDN博客
llvm从对应的github仓库的release里面下载aarch64的对应版本的预编译好的文件,解压以后添加环境变量。开始我选的是LLVM 17.0.5,安装报错后我选择安装LLVM 17.0.4,安装成功
Releases · llvm/llvm-project · GitHub
接下来安装llvmlite:
pip install llvmlite
二者版本对应关系:llvmlite · PyPI
下载OpenPCDet v0.6.0
git clone https://github.com/open-mmlab/OpenPCDet.git
unzip OpenPCDet-master.zip
mv OpenPCDet-master OpenPCDet
cd OpenPCDet
pip install -r requirements.txt
python3 setup.py develop或者把报错都解决后python3 setup.py install
将所有代码中Tensor.data<…>()替换为Tensor.data_ptr<…>()
(总共替换142处,都是pcdet/ops/中的文件,反正全部替换过来即可)
将所有代码中x.type()的".type()"删去即可,即代码中的x.type().is_cuda()替换为x.is_cuda()
(总共11处,都是pcdet/ops/中的文件)
将setup.py中的“cmdclass={‘build_ext’: BuildExtension}”这一行改为“cmdclass={‘build_ext’: BuildExtension.with_options(use_ninja=False)}”,pytorch默认使用ninjia作为backend,这里把它禁用掉就好了;
网上有一些方法让将torch/utils/cpp_extension.py中的[‘ninja’,‘-v’]改成[‘ninja’,‘–version’],这个方法或许可行,但修改系统文件是很危险的,不建议这么做。
OpenPCDet
├── checkpoints
│ ├── pointrcnn_7870.pth
├── data
├── pcdet
├── tools
OpenPCDet
├── data
│ ├── kitti
│ │ │── ImageSets
│ │ │── training
│ │ │ ├──calib & velodyne & label_2 & image_2 & (optional: planes) & (optional: depth_2)
│ │ │── testing
│ │ │ ├──calib & velodyne & image_2
├── pcdet
├── tools
cd data/kitti
ln -s ~/volume/PointRCNN/data/KITTI/object/training/ training
ln -s ~/volume/PointRCNN/data/KITTI/object/testing/ testing
cd OpenPCDet
python3 -m pcdet.datasets.kitti.kitti_dataset create_kitti_infos tools/cfgs/dataset_configs/kitti_dataset.yaml
python3 demo.py --cfg_file cfgs/kitti_models/pointrcnn.yaml --ckpt ../checkpoints/pointrcnn_7870.pth --data_path ../data/kitti/training/velodyne/000008.bin
ModuleNotFoundError: No module named ‘pcdet’
在demo.py中加入
import sys
sys.path.append(PATH) #OpenPCDet/所在路径
由于在命令行没有可视化界面,所以貌似运行不了。。。
2023-11-20 12:54:40,716 INFO Visualized sample index: 1
[Open3D WARNING] GLFW Error: X11: The DISPLAY environment variable is missing
[Open3D WARNING] Failed to initialize GLFW
Traceback (most recent call last):
File "demo.py", line 113, in <module>
main()
File "demo.py", line 101, in main
V.draw_scenes(
File "/root/volume/OpenPCDet/tools/visual_utils/open3d_vis_utils.py", line 49, in draw_scenes
vis.get_render_option().point_size = 1.0
AttributeError: 'NoneType' object has no attribute 'point_size'
python3 test.py --cfg_file cfgs/kitti_models/pointrcnn.yaml --batch_size 16 --ckpt ../checkpoints/pointrcnn_7870.pth --infer_time
2023-11-20 13:13:46,784 INFO Car AP@0.70, 0.70, 0.70: bbox AP:90.7820, 89.6547, 89.2056 bev AP:90.0484, 87.3777, 86.5750 3d AP:88.6188, 78.5465, 77.6281 aos AP:90.77, 89.56, 89.04 Car AP_R40@0.70, 0.70, 0.70: bbox AP:96.4662, 92.9027, 90.5241 bev AP:93.2005, 89.0023, 86.8322 3d AP:91.0759, 80.4579, 77.9758 aos AP:96.45, 92.80, 90.36 Car AP@0.70, 0.50, 0.50: bbox AP:90.7820, 89.6547, 89.2056 bev AP:90.7446, 89.7929, 89.5078 3d AP:90.7446, 89.7603, 89.4514 aos AP:90.77, 89.56, 89.04 Car AP_R40@0.70, 0.50, 0.50: bbox AP:96.4662, 92.9027, 90.5241 bev AP:96.4749, 95.0989, 92.8830 3d AP:96.4751, 94.9145, 92.7614 aos AP:96.45, 92.80, 90.36 Pedestrian AP@0.50, 0.50, 0.50: bbox AP:73.5095, 65.7689, 62.2409 bev AP:63.4347, 58.9105, 52.5143 3d AP:61.3689, 53.8344, 49.9219 aos AP:71.22, 62.94, 59.31 Pedestrian AP_R40@0.50, 0.50, 0.50: bbox AP:74.4947, 67.7302, 61.0813 bev AP:64.8432, 57.5454, 50.9380 3d AP:61.2496, 54.0018, 47.3366 aos AP:71.96, 64.48, 57.96 Pedestrian AP@0.50, 0.25, 0.25: bbox AP:73.5095, 65.7689, 62.2409 bev AP:81.8234, 74.9909, 67.2878 3d AP:81.7957, 74.9260, 67.1490 aos AP:71.22, 62.94, 59.31 Pedestrian AP_R40@0.50, 0.25, 0.25: bbox AP:74.4947, 67.7302, 61.0813 bev AP:82.9904, 76.4039, 69.1696 3d AP:82.9573, 76.2548, 68.9429 aos AP:71.96, 64.48, 57.96 Cyclist AP@0.50, 0.50, 0.50: bbox AP:95.6644, 77.2475, 75.1094 bev AP:86.7136, 72.5822, 66.7247 3d AP:85.6353, 66.7699, 64.9785 aos AP:95.28, 76.71, 74.54 Cyclist AP_R40@0.50, 0.50, 0.50: bbox AP:96.8042, 77.6159, 74.4501 bev AP:91.8013, 72.1001, 68.8331 3d AP:90.3282, 68.6796, 65.4311 aos AP:96.38, 77.03, 73.85 Cyclist AP@0.50, 0.25, 0.25: bbox AP:95.6644, 77.2475, 75.1094 bev AP:94.4500, 75.1637, 72.8663 3d AP:94.4500, 75.1637, 72.8663 aos AP:95.28, 76.71, 74.54 Cyclist AP_R40@0.50, 0.25, 0.25: bbox AP:96.8042, 77.6159, 74.4501 bev AP:95.6110, 75.4792, 72.1654 3d AP:95.6110, 75.4792, 72.1654 aos AP:96.38, 77.03, 73.85
/usr/local/lib/python3.8/dist-packages/numba/core/typed_passes.py:334: NumbaPerformanceWarning:
The keyword argument 'parallel=True' was specified but no transformation for parallel execution was possible.
To find out why, try turning on parallel diagnostics, see https://numba.readthedocs.io/en/stable/user/parallel.html#diagnostics for help.
File "../pcdet/datasets/kitti/kitti_object_eval_python/eval.py", line 122:
@numba.jit(nopython=True, parallel=True)
def d3_box_overlap_kernel(boxes, qboxes, rinc, criterion=-1):
把parallel=True改为parallel=False
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。