栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

PCDet环境安装:PVRCNN网络环境配置

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

PCDet环境安装:PVRCNN网络环境配置

PVRCNN环境搭建:

Reference:

PVRCNN环境搭建

环境框架:OpenPCDet

点击主页Installation

Spconv:

References:

instructions on how to successfully build spconv 1.0 #152

设置spconv的CMakelists

spconv1.2.1参考 README

conda虚拟环境创建

cuda版本要与本机一致(如工控机为10.0)

cuda10.1+cudnn7.6.5+spconv1.2.1+pytorch1.3

conda create --name PVRCNN_NEW python=3.7 pytorch=1.3 cudatoolkit=10.1 cudatoolkit-dev=10.1 cmake --channel pytorch --channel=conda-forge
conda activate PVRCNN_NEW
conda install cudnn
conda install boost

Error:

PackagesNotFoundError: The following packages are not available from current channels(换成国内源)

下载spconv1.2.1(git clone)

spconv1.2.1的位置在此处

下载zip

修改CMakeLists

安装spconv时由于基本的路径都是在home自己的用户名下,所以需要更改。参考博客:3D目标检测算法配置–CIA-SSD与spconv1.2的安装注意spconv1.2.1的位置在此处

CUDA_ROOT=/home/qinjia/Software/anaconda3/envs/PVRCNN_NEW python setup.py bdist_wheel
cd dist/
pip install *

Test spconv via:
python -c 'import spconv'
(should just return and not raise any errors)

Error:

1 pybind11找不到

pybind11地址

进入third_party,删除pybind11空目录,重新git clone即可。

若spconv安装出错,可尝试复制成功的目录,直接进入dist安装。

PCDet

Reference:https://blog.csdn.net/weixin_44579633/article/details/107820311

安装依赖

进入到OpenPCDet目录下,安装所有依赖

cd OpenPCDet
pip install -r requirements.txt 

安装
运行setup.py来安装pcdet

python setup.py develop

检验
检验是否安装成功,无报错即可

python 
import pcdet

Test:

python -c ‘import pcdet’

注意

pcdet的环境可能会与spconv环境冲突,如pytorch版本不一致,导致两个其中一个不能运行,以下是推荐的requirements文件:

numpy
torch==1.3.1
numba
tensorboardX
easydict
pyyaml
scikit-image
tqdm
kornia
torchvision

如图,我直接执行pcdet的setup,就会报版本错误,numpy过高

执行requirements,发现pytorch被改为1.3.0


安装好spconv和pcdet后,即可开始模型生成与训练

  1. Generate the data infos by running the following command:
python -m pcdet.datasets.kitti.kitti_dataset create_kitti_infos tools/cfgs/dataset_configs/kitti_dataset.yaml

会出现TypeError: load() missing 1 required positional argument: ‘Loader’ 的错误,这是由于新的pyyaml 6.0版本不兼容低版本,可以下载5.4.1版本 pip install pyyaml==5.4.1
最终成功的截图如图:

Error:

ImportError: libtorch_cpu.so: cannot open shared object file: No such file or directory

删掉build重新编译

assert img_file.exists() AssertionError

/data1/qinjia/OpenPCDet_KITTI/data/kitti/ImageSets中查看测试集、训练集的编码

Error:

WARNING: Imported VTK version (9.1) does not match the one used
to build the TVTK classes (8.1). This may cause problems.
Please rebuild TVTK.

ImportError: cannot import name ‘PILLOW_VERSION’ from ‘PIL’ (/home/fieldrover/anaconda3/envs/PVRCNN_NEW/lib/python3.7/site-packages/PIL/init.py)

Solution:

重装conda install vtk=8.1.2

conda install pillow=8.4

Pytorch错误:Torch not compiled with CUDA enabled

pytorch安成了cpu版

检查:

import torch
print(torch.__version__)
print(torch.cuda.is_available())

重装:
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

https://www.jianshu.com/p/cacbec7a7b0d

https://blog.csdn.net/u014723479/article/details/103001861

经验:

环境问题:删掉rebuild

PVRCNN

Reference:OpenPCDet_getting_started
The dataset configs are located within tools/cfgs/dataset_configs,
and the model configs are located within
tools/cfgs for different datasets.
如:pv_rcnn.yaml在cfgs/kitti_models/pv_rcnn.yaml

PV-RCNN代码应用——更改测试集文件
PV-RCNN代码应用——参数修改

PV-RCNN代码解读——demo.py & test.py

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/949895.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号