> 文章列表 > linux安装Detectron2

linux安装Detectron2

linux安装Detectron2

参考官方文档:https://detectron2.readthedocs.io/en/latest/tutorials/install.html

1.使用image拉取docker

image链接:https://hub.docker.com/r/pytorch/pytorch/tags?page=1&name=1.8.1-cuda11.1-cudnn8-devel
linux安装Detectron2

左上角红框这里搜索1.8.1-cuda11.1-cudnn8-devel
在linux终端输入右下角红框命令,下载images,完成后在linux终端输入
docker run -d -v /home/ubuntu/Detectron2/:/home/workspace_disk/ --name Detectron2 --gpus all --shm-size 64G -it pytorch/pytorch:1.8.1-cuda11.1-cudnn8-devel /bin/bash

完成:
linux安装Detectron2

2.安装Detectron2

输入python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
有时候会出现linux安装Detectron2
那就再输入一次。

有时会发现卡在某一个包
linux安装Detectron2
那就自己用pip能快点

pip install matplotlib==3.7.1 -i https://mirrors.aliyun.com/pypi/simple

然后继续重试。
大概需要的包有这些:
Pillow>=7.1
hydra_core==1.3.2
pycocotools>=2.0.2
matplotlib
termcolor>=1.1
yacs-0.1.8
tabulate-0.9.0
cloudpickle-2.2.1
tqdm>4.29.0
tensorboard
fvcore<0.1.6,>=0.1.5
iopath<0.1.10,>=0.1.7
omegaconf>=2.1
hydra-core>=1.1

成功:

linux安装Detectron2

我爱穿衣打扮