安装指定版本的detectron2-Linux版

我们想要复现的代码往往不是在最新的detectron2上复现,需要我们使用先前版本的detectron2才能复现网络,因此需要重新下载detectron2并配置环境。

1、来到detectron2官网

地址:https://github.com/facebookresearch/detectron2
寻找需要的版本,并下载,这里我们以v0.3为例:
在这里插入图片描述

2、创建虚拟环境detectron2-v0.3

conda create -n detectron2-v0.3 python=3.7

在这里插入图片描述创建成功:
在这里插入图片描述

3、激活虚拟环境

在这里插入图片描述

4、安装合适的torch和torchvision版本

可在INSTALL.MD中查阅到:
在这里插入图片描述
此处我们安装torch1.7及其对应的torchvision版本(可在pytorch官网查阅:https://pytorch.org/get-started/previous-versions/)

pip install torch==1.7.0 torchvision==0.8.0

在这里插入图片描述
pytorch安装完成。

5、安装COCOapi

方法一:pip安装(可能会失败)

pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'

在这里插入图片描述
在这里插入图片描述
方法二:离线安装
地址:https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI’

6、安装一些依赖包

pip install fvcore==0.1.5.post20210415

pip install omegaconf==2.1.0.

pip install importlib

7、安装并编译detectron2

python setup.py build develop

安装编译完成:
在这里插入图片描述

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值