部署mmdetection3d到服务器_采坑记录
最近刚刚开通了学校的超算付费账号,终于有上好的gpu可以用了= =
之前折腾环境花了不少时间,这次先整理一下在超算上配置mmdetection3d的一些操作。。
这次主要的问题在于使用salloc连接了超算是无法联网的,因此pip、conda都没法用,所以尝试使用module load出cuda的环境进行安装。。。本以为不能跑通,因为只有环境没有cuda核心可以使用。。。但是 还是通了,那行。
前提
假设,目前已经拥有以下环境:
- 付费账号 ;
- 本地环境 ;
步骤
1、建立一个新的py环境
略
2、进入并配置环境
conda activate open-mmlab
module load nvidia/cuda/10.1
module load scl/gcc7.3
3、安装mmdetection3d
这里安装官网上的流程走的就可以啦,我这里记录我的流程
# install mmcv
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.5.0/index.html
pip install mmcv-full
#这里装两次是前人从经验摸索出来的
# install mmdetection
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install -v -e . # or "python setup.py develop"
# install mmdetection3d
git clone https://github.com/open-mmlab/mmdetection3d.git
cd mmdetection3d
pip install -v -e .
至此,mmdet3d就算是装完了。
验证
登录超算,salloc登入,载入环境
ssh ***@swarm.whu.edu.cn
salloc -A *** -p gpu --gres=gpu:1 --time=01:00:00
cd project/mmdetection3d
conda activate open-mmlab
module load nvidia/cuda/10.1
module load scl/gcc7.3
上传好文件,运行测试代码,差啥补啥
python demo/pcd_demo.py demo/kitti_000008.bin configs/second/hv_second_secfpn_6x8_80e_kitti-3d-car.py checkpoints/hv_second_secfpn_6x8_80e_kitti-3d-car_20200620_230238-393f000c.pth
补充
当然你有可能会和我一样碰到
Traceback (most recent call last):
File "demo/pcd_demo.py", line 3, in <module>
from mmdet3d.apis import inference_detector, init_detector, show_result_meshlab
File "/project/liuzhao/mmdetection3d/mmdet3d/apis/__init__.py", line 1, in <module>
from .inference import (convert_SyncBN, inference_detector, init_detector,
File "/project/liuzhao/mmdetection3d/mmdet3d/apis/inference.py", line 10, in <module>
from mmdet3d.datasets.pipelines import Compose
File "/project/liuzhao/mmdetection3d/mmdet3d/datasets/__init__.py", line 1, in <module>
from mmdet.datasets.builder import build_dataloader
File "/project/liuzhao/mmdetection/mmdet/datasets/__init__.py", line 2, in <module>
from .cityscapes import CityscapesDataset
File "/project/liuzhao/mmdetection/mmdet/datasets/cityscapes.py", line 16, in <module>
from .coco import CocoDataset
File "/project/liuzhao/mmdetection/mmdet/datasets/coco.py", line 21, in <module>
assert pycocotools.__version__ >= '12.0.2'
AttributeError: module 'pycocotools' has no attribute '__version__'
这是由于pycocotools和mmpycocotools冲突,需要重装
pip uninstall pycocotools --no-cache-dir -y
pip install mmpycocotools --no-cache-dir --force --no-deps