OpenMMLab通用视觉框架(mmdetection)安装使用详解

mmcv安装

  1. 首先要安装pytorch和CUDA,如果已经安装,进行第二步
    pytotch:官网(安装GPU版本)
    CUDA:官网
    安装完成后记住你安装的版本,建议使用conda安装
    查看torch版本:pip list
  2. 安装mmcv
    mmcv:GitHub链接
    支持的CUDA和torch的版本
    在这里插入图片描述
    安装:pip install mmcv-full=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
    cu111:为你已经安装的CUDA版本
    torch1.9.0为你已经安装的pytorch版本
    {mmcv_version}:换成对应的mmcv版本

报错解决

  D:\anconda\lib\site-packages\torch\utils\cpp_extension.py:305: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
    warnings.warn(f'Error checking compiler version for {compiler}: {error}')
  building 'mmcv._ext' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  Error in atexit._run_exitfuncs:

在这里插入图片描述
解决1使用mmcv
使用安装命令pip install mmcv=={mmcv_version} -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
cu111:为你已经安装的CUDA版本(用本地的版本替换)
torch1.9.0为你已经安装的pytorch版本(用本地的版本替换)
{mmcv_version}:换成对应的mmcv版本(用本地的版本替换)

解决2安装c++解释器
步骤见我的博客

mmcv使用前准备

检查安装

import torch
import torchvision
import mmdet
from mmcv.ops import get_compiling_cuda_version,get_compiler_version
# 检查pytorch和cuda是否可用
print(torch.__version__, torch.cuda.is_available())
# 检查mmdet是否可用
print(mmdet.__version__)
# 检查mmcv安装是否成功
print(get_compiling_cuda_version())
print(get_compiler_version())

结果如图为安装成功!
在这里插入图片描述

下载训练好的模型

在这里插入图片描述

  1. 首先下载这个文件,然后将configs复制到项目中链接
  2. 模型的下载,点击这里
    在这里插入图片描述
    这里使用的是R-50-FPN,下载model然后导入到项目中!
    在这里插入图片描述
  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

啊~小 l i

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值