当前位置: 首页 > news >正文

安装OpenPCDet碰到的问题

Ubuntu18.04重新安装了,现在要把OpenPCDet也重新装上,按照官方的教程来,一路安装好了torch, numpy之类的东西,没碰到问题,之后 开始安装OpenPCDet,然后就碰到了下面的问题,

问题1  IndexError: list index out of range


(openmmlab) user@MS-7816:~/devAI/OpenPCDet$ python setup.py develop
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
running develop
running egg_info
writing pcdet.egg-info/PKG-INFO
writing dependency_links to pcdet.egg-info/dependency_links.txt
writing requirements to pcdet.egg-info/requires.txt
writing top-level names to pcdet.egg-info/top_level.txt
reading manifest file 'pcdet.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'pcdet.egg-info/SOURCES.txt'
running build_ext
building 'pcdet.ops.iou3d_nms.iou3d_nms_cuda' extension
Traceback (most recent call last):
  File "setup.py", line 114, in <module>
    'src/sampling_gpu.cu',
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/setuptools/command/develop.py", line 114, in install_for_development
    self.run_command('build_ext')
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 709, in build_extensions
    build_ext.build_extensions(self)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 202, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 525, in unix_wrap_ninja_compile
    cuda_post_cflags = unix_cuda_flags(cuda_post_cflags)
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 424, in unix_cuda_flags
    cflags + _get_cuda_arch_flags(cflags))
  File "/home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1562, in _get_cuda_arch_flags
    arch_list[-1] += '+PTX'
IndexError: list index out of range

然后到网上查看了一圈,说是nvidia没安装好,解决办法如下,

可见,最初的错误是:

    CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero.


https://github.com/pytorch/pytorch/issues/49081#issuecomment-766793705
上找到解决方法:

    yurunsheng1 commented on 25 Jan

    apt-get install nvidia-modprobe

    This works for me.

这个也work for me.

    The nvidia-modprobe utility is used by user-space NVIDIA driver components to make sure the NVIDIA kernel module is loaded and that the NVIDIA character device files are present. These facilities are normally provided by Linux distribution configuration systems such as udev.

然后我试了一下,不行,依然报错,不过,我另外检查了一下我的nividia驱动,

$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

nvidia驱动找不到,这个问题有点怪,因为我确定安装过了。于是找到自己以前的贴子,

《Ubuntu18.04查看显卡信息并安装NVDIA显卡驱动driver + Cuda + Cudnn》

https://blog.csdn.net/tanmx219/article/details/107591416

$ ubuntu-drivers devices
WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001B06sv00001458sd00003752bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP102 [GeForce GTX 1080 Ti]
driver   : nvidia-driver-470-server - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-495 - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-460 - distro non-free
driver   : nvidia-driver-460-server - distro non-free
driver   : nvidia-driver-470 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

发现推荐的是

nvidia-driver-470 - distro non-free recommended

根据上面的链接,找到官方地址:

NVIDIA DRIVERS Linux x64 (AMD64/EM64T) Display Driver

下载下来后安装好,

$ sudo sh NVIDIA-Linux-x86_64-470.86.run

安装过程可以参考我上面给出的链接《Ubuntu18.04查看显卡信息并安装NVDIA显卡驱动driver + Cuda + Cudnn》。

检查一下,OK了,

$ nvidia-smi
Thu Dec  2 10:40:45 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.86       Driver Version: 470.86       CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| 32%   27C    P5    43W / 300W |      0MiB / 11178MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

开始安装,

(openmmlab) matthew@matthew-MS-7816:~/devAI$  cd OpenPCDet
(openmmlab) matthew@matthew-MS-7816:~/devAI/OpenPCDet$ python setup.py develop

一路顺利,不过很快第二个错误出现了,

各个包的版本问题,如llvmlite ,numpy, pillow, etc.

error: llvmlite 0.38.0rc1 is installed but llvmlite<0.38,>=0.37.0rc1 is required by {'numba'}

没有什么特别的办法,一路 上改版本,一个个地装,全部安装过程在下面,

(openmmlab) matthew@matthew-MS-7816:~/devAI/OpenPCDet$ pip install llvmlite==0.37
Collecting llvmlite==0.37
  Downloading llvmlite-0.37.0-cp37-cp37m-manylinux2014_x86_64.whl (26.3 MB)
     |████████████████████████████████| 26.3 MB 115 kB/s 
Installing collected packages: llvmlite
  Attempting uninstall: llvmlite
    Found existing installation: llvmlite 0.38.0rc1
    Uninstalling llvmlite-0.38.0rc1:
      Successfully uninstalled llvmlite-0.38.0rc1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pcdet 0.5.0+3fa8b51 requires numpy<=1.20, but you have numpy 1.21.2 which is incompatible.
numba 0.54.1 requires numpy<1.21,>=1.17, but you have numpy 1.21.2 which is incompatible.
Successfully installed llvmlite-0.37.0

(openmmlab) matthew@matthew-MS-7816:~/devAI/OpenPCDet$ pip install numpy==1.20
Collecting numpy==1.20
  Downloading numpy-1.20.0-cp37-cp37m-manylinux2010_x86_64.whl (15.3 MB)
     |████████████████████████████████| 15.3 MB 12 kB/s 
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.21.2
    Uninstalling numpy-1.21.2:
      Successfully uninstalled numpy-1.21.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
imageio 2.13.1 requires pillow>=8.3.2, but you have pillow 8.3.1 which is incompatible.
Successfully installed numpy-1.20.3

(openmmlab) matthew@matthew-MS-7816:~/devAI/OpenPCDet$ pip install pillow==8.3.2
Collecting pillow==8.3.2
  Downloading Pillow-8.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB)
     |████████████████████████████████| 3.0 MB 482 kB/s 
Installing collected packages: pillow
  Attempting uninstall: pillow
    Found existing installation: Pillow 8.3.1
    Uninstalling Pillow-8.3.1:
      Successfully uninstalled Pillow-8.3.1
Successfully installed pillow-8.3.2
(openmmlab) matthew@matthew-MS-7816:~/devAI/OpenPCDet$ python setup.py develop
.......................................
Using /home/matthew/anaconda3/envs/openmmlab/lib/python3.7/site-packages
Finished processing dependencies for pcdet==0.5.0+3fa8b51
(openmmlab) matthew@matthew-MS-7816:~/devAI/OpenPCDet$



然后python setup.py develop搞定。

最后,晒一张跑通的PV-RCNN图片

 

相关文章:

  • Python3.8上安装vtk和mayavi踩坑: Building wheel for mayavi (setup.py) ...
  • ubuntu中如何显示或隐藏配置文件夹如.config
  • vscode没法选python解释器interpreter
  • 在windows10上安装运行ROS2
  • Ubuntu18.04 安装 ros2 foxy
  • VSCode常用操作
  • Ceres-Solver安装与简介
  • SLAM算法VINS-MONO安装运行介绍
  • Protobuf,gmock,gtest在windows10上的编译与安装
  • CMD闪退的问题及报错“点的大小应介于5和72之间”
  • 常用git 指令
  • 常用的anaconda(conda)命令
  • pcl_viewer的使用与viewer窗口编程
  • OpenVINO+Yolov5+Windows10的CPU部署
  • PCD(点云数据)文件格式
  • JavaScript-如何实现克隆(clone)函数
  • angular学习第一篇-----环境搭建
  • css布局,左右固定中间自适应实现
  • CSS盒模型深入
  • IDEA 插件开发入门教程
  • IndexedDB
  • Java 内存分配及垃圾回收机制初探
  • java小心机(3)| 浅析finalize()
  • Js基础知识(一) - 变量
  • React Native移动开发实战-3-实现页面间的数据传递
  • SpiderData 2019年2月25日 DApp数据排行榜
  • TCP拥塞控制
  • TypeScript迭代器
  • UEditor初始化失败(实例已存在,但视图未渲染出来,单页化)
  • Vue2 SSR 的优化之旅
  • Vultr 教程目录
  • 极限编程 (Extreme Programming) - 发布计划 (Release Planning)
  • 深入体验bash on windows,在windows上搭建原生的linux开发环境,酷!
  • 使用Gradle第一次构建Java程序
  • 新书推荐|Windows黑客编程技术详解
  • “十年磨一剑”--有赞的HBase平台实践和应用之路 ...
  • ​MySQL主从复制一致性检测
  • ###项目技术发展史
  • (1)Map集合 (2)异常机制 (3)File类 (4)I/O流
  • (2)STM32单片机上位机
  • (Bean工厂的后处理器入门)学习Spring的第七天
  • (C语言)编写程序将一个4×4的数组进行顺时针旋转90度后输出。
  • (附源码)springboot 智能停车场系统 毕业设计065415
  • (附源码)springboot建达集团公司平台 毕业设计 141538
  • (排序详解之 堆排序)
  • (三)Hyperledger Fabric 1.1安装部署-chaincode测试
  • (五)Python 垃圾回收机制
  • (原創) 如何讓IE7按第二次Ctrl + Tab時,回到原來的索引標籤? (Web) (IE) (OS) (Windows)...
  • (转)为C# Windows服务添加安装程序
  • (转载)PyTorch代码规范最佳实践和样式指南
  • ./configure,make,make install的作用
  • .net core Swagger 过滤部分Api
  • .NET Core 版本不支持的问题
  • .NET Reactor简单使用教程
  • .NET处理HTTP请求