简单粗暴-安装detectron2


其他配置版本:

  • torch1.12.1
  • CUDA:11.6
  • python:3.9
    建议以上配置,其他配置未测试,如果CUDA版本不匹配的话,可以多配置不同版本的CUDA,不必删除原来的CUDA。参考链接:多CUDA版本管理

安装配置:torch、CUDA、python参考:

  1. CUDA、torch
  2. python_anaconda
  3. python_pycharm

一、下载detectron2

下载压缩包zip,并解压备用:https://github.com/facebookresearch/detectron2

二、修改文件

文件路径地址:detectron2\detectron2\layers\csrc\nms_rotated\nms_rotated_cuda.cu
用记事本打开
原内容:

// Copyright (c) Facebook, Inc. and its affiliates.
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include <ATen/cuda/CUDAApplyUtils.cuh>
#ifdef WITH_CUDA
#include "../box_iou_rotated/box_iou_rotated_utils.h"
#endif
// TODO avoid this when pytorch supports "same directory" hipification
#ifdef WITH_HIP
#include "box_io

修改后的内容:

// Copyright (c) Facebook, Inc. and its affiliates.
#include <ATen/ATen.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include <ATen/cuda/CUDAApplyUtils.cuh>
/*#ifdef WITH_CUDA
#include "../box_iou_rotated/box_iou_rotated_utils.h"
#endif
// TODO avoid this when pytorch supports "same directory" hipification
#ifdef WITH_HIP
#include "box_iou_rotated/box_iou_rotated_utils.h"
#endif*/
#include "box_iou_rotated/box_iou_rotated_utils.h"

三、安装detectron2

步骤:进入detectron2解压包(该文件夹下含有setup.py),在空白出右键->终端打开->激活你相应的虚拟环境->输入:python setup.py build develop
如图所示:
python setup.py build develop
下载可能会挺久的。

参考文献:

  • https://blog.csdn.net/weixin_43907922/article/details/138082343
  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值