记录自己fork少样本检测代码FSOD中遇到的问题和解决方法

记录自己fork少样本检测代码FSOD中遇到的问题和解决方法
fsod-code
paper
参考:参考一
主要在编译sh文件时候出现了两个问题:
第一个问题,是缺少了文件nms_cuda.c

gcc: error: /home/zytr/桌面/FSOD-code-master/lib/model/nms/src/nms_cuda.c: 没有那个文件或目录
gcc: fatal error: no input files

欢迎使用Markdown编辑器

解决方法:
自己新建一个nms_cuda.c文件

#include <THC/THC.h>
#include <stdio.h>
#include "nms_cuda_kernel.h"

// this symbol will be resolved automatically from PyTorch libs
extern THCState *state;

int nms_cuda(THCudaIntTensor *keep_out, THCudaTensor *boxes_host,
		     THCudaIntTensor *num_out, float nms_overlap_thresh) {

    nms_cuda_compute(THCudaIntTensor_data(state, keep_out),
                     THCudaIntTensor_data(state, num_out),
                     THCudaTensor_data(state, boxes_host),
                     THCudaTensor_size(state, boxes_host, 0),
                     THCudaTensor_size(state, boxes_host, 1),
                     nms_overlap_thresh);

	return 1;
}

第二个问题:
一直报.DistutilsExecError: command ‘gcc’ failed with exit status 这个错误,应该是GCC版本的问题,需要对应。然后会导致后面的文件没办法生成,所以应该去解决gcc failed的问题,因为用的是9.0的cuda,应该指定-arch=sm_61,这样便没有问题了。

cd src
echo "Compiling stnm kernels by nvcc..."
nvcc -c -o nms_cuda_kernel.cu.o nms_cuda_kernel.cu -x cu -Xcompiler -fPIC -arch=sm_52

cd ../
python build.py
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值