如何在ubuntu下安装detectron2_搭建 detectron2 + pytorch + cuda 的ubuntu镜像

由于业务要求,需要搭建运行coco数据集的环境。具体的环境配置要求如下:

ubuntu

pytorch: 1.6

torchvision: 0.7.0

detectron2: 0.2.1

cudatoolkit: 10.1

基础镜像

我选用的基础镜像为:registry.cn-huhehaote.aliyuncs.com/lumo/pytorch-with-tensorboard:1.5.1-cuda10.1-cudnn7-runtime

(这个镜像是 arena github 上提交 pytorch 任务的事例命令行中的镜像地址,里面已经安装好了 python3.7.7,anaconda,pytorch 1.5.1,nvidia-smi 10.1)

启动并进入容器

使用 docker pull 将上述镜像拉到本地,然后基于该镜像启动容器。

docker pull registry.cn-huhehaote.aliyuncs.com/lumo/pytorch-with-tensorboard:1.5.1-cuda10.1-cudnn7-runtime

docker images | grep registry.cn-huhehaote.aliyuncs.com/lumo/pytorch-with-tensorboard:1.5.1-cuda10.1-cudnn7-runtime (得到镜像id ${image_id})

docker run -it --name ${container_name} ${image_id} /bin/bash

开启与新容器的交互式命令行。

docker ps | grep ${container_name} (得到容器id ${container_id})

docker exec -it ${container_id} /bin/bash

安装环境

参考文章:detectron2云服务器部署 安装 测试

很优秀的文章,进入容器中基本就是按照上面的步骤做的。

安装 vim

apt update

apt install vim

修改 ubuntu apt 源

备份:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

修改:

vim /etc/apt/sources.li

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值