Environment
PointRCNN
环境创建与激活
conda create -n pointrcnn python=3.8
conda activate pointrcnn
安装pytorch
wget http://download.pytorch.org/whl/cu101/torch-1.4.0-cp38-cp38-linux_x86_64.whl
pip install torch-1.4.0-cp38-cp38-linux_x86_64.whl
Install dependent libraries
pip install easydict tqdm tensorboardX scipy pillow fire scikit-image numba pyyaml
Build and install the pointnet2_lib, iou3d, roipool3d libraries
dos2unix build_and_install.sh
sh build_and_install.sh
Dataset preparation
PointRCNN
├── data
│ ├── KITTI
│ │ ├── ImageSets
│ │ ├── object
│ │ │ ├──training
│ │ │ ├──calib & velodyne & label_2 & image_2 & (optional: planes)
│ │ │ ├──testing
│ │ │ ├──calib & velodyne & image_2
├── lib
├── pointnet2_lib
├── tools
Quick demo
python eval_rcnn.py --cfg_file cfgs/default.yaml --ckpt PointRCNN.pth --batch_size 1 --eval_mode rcnn --set RPN.LOC_XZ_FINE False
2022-03-30 13:55:03,864 INFO Car AP@0.70, 0.70, 0.70:
bbox AP:96.9112, 89.5387, 88.7494
bev AP:90.2194, 87.8969, 85.5214
3d AP:89.1975, 78.8578, 77.9157
aos AP:96.90, 89.42, 88.55
Car AP@0.70, 0.50, 0.50:
bbox AP:96.9112, 89.5387, 88.7494
bev AP:97.0926, 89.8168, 89.3443
3d AP:97.0529, 89.7747, 89.2549
aos AP:96.90, 89.42, 88.55
问题
- TypeError: load() missing 1 required positional argument: ‘Loader’
Traceback (most recent call last):
File "eval_rcnn.py", line 865, in <module>
cfg_from_file(args.cfg_file)
File "/home/chengjunlong/Work/PointRCNN/tools/../lib/config.py", line 188, in cfg_from_file
yaml_cfg = edict(yaml.load(f))
TypeError: load() missing 1 required positional argument: 'Loader'
- 原因
由于Yaml 5.1版本后弃用了 yaml.load(file) 这个用法。Yaml 5.1版本之后就修改了需要指定Loader,通过默认加载器(FullLoader)禁止执行任意函数,使得此load函数的安全得到加强。 - 解决方案
yaml_cfg = edict(yaml.safe_load(f))