mmdetection3安装过程失败记录
本人最近安装mmdection3d过程中遇见了几个坑,想在此记录一下解决办法,给后续的小伙伴提供参考。
错误1
note: This error originates from a subprocess, and is likely not a problem with pip.
一开始在安装mmcv-full就报了这个错,就在网上找了很多教程。很多博主说是由于缺少C++编译造成的,但是我的电脑之前安装过Visual Studio Community,所以应该不是这个原因。最后在github和谷歌上找了好久也没有找到解决方法,百思不得解。
在空闲之余,想到可能是torch版本的问题,本人的环境配置如下:
Cuda:9.2
Torch:1.5.1
所以就觉得可能是torch版本太老了导致的,就决定重新配置一下环境,卸载和重装Cuda和CUDNN的教程参考如下:
https://zhuanlan.zhihu.com/p/102966512/
然后参考教程升级Cuda版本至10.2,并安装了1.9版本的torch.接下来安装mmcv-full就没有报错。
错误2
本以为可以畅通无阻安装了,结果在安装mmdet的时候又报错如下:
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based pro
解决的办法是使用conda而不是pip进行安装:
conda install -c conda-forge pycocotools
在成功安装了pycocotools之后,顺利安装了mmdet3d,安装过程参考官方安装教程:
pip install openmim
mim install mmcv-full
mim install mmdet
mim install mmsegmentation
git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
pip install -e .
最后测试一下,确实安装成功了!
Python 3.8.0 (default, Nov 6 2019, 16:00:02) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mmdet3d
>>>