编译GTR-Master,即编译detectron2成功的经验

安装gtr-master需要编译依赖的子项目 detectron2,但官方不支持windows. 我编译了一下,有很多错误. 看第一个error, 想方法解决第一个错误.

nms_rotated_cuda.cu里有报错,我改后的开头代码如下:

#include <ATen/ATen.h>

#include <ATen/cuda/CUDAContext.h>

#include <c10/cuda/CUDAGuard.h>

#include <ATen/cuda/CUDAApplyUtils.cuh>

#ifdef WITH_CUDA

#endif

// TODO avoid this when pytorch supports "same directory" hipification


 

//#include "detectron2/detectron2/layers/csrc/box_iou_rotated.h"

#include "F:/00reidother/GTR-master/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated.h"

#include "F:/00reidother/GTR-master/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_utils.h"

//#include "box_iou_rotated/box_iou_rotated.h"

//F:\00reidother\GTR-master\detectron2\detectron2\layers\csrc\box_iou_rotated

using namespace detectron3;

using namespace detectron2;

namespace  {

int const threadsPerBlock = sizeof(unsigned long long) * 8;

}

另外box_iou_rotated_utils.h里 我改名了命名空间,开头部分代码是:

#include <algorithm>

#define HOST_DEVICE

#define HOST_DEVICE_INLINE HOST_DEVICE inline

#endif

namespace detectron3 {

template <typename T>

struct RotatedBox {

  T x_ctr, y_ctr, w, h, a;

};

另外:single_box_iou_rotated 把末尾的这个方法移动到detectron3 这个命名空间里. 编译就成功了.

我使用的vs2019

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值