美文网首页
解决 from lib.nms.gpu_nms import g

解决 from lib.nms.gpu_nms import g

作者: JIAWEIJIAWEI | 来源:发表于2020-01-09 21:12 被阅读0次

from lib.nms.gpu_nms import gpu_nms

改成

from lib.nms.nums_py import py_cpu_nms

另外

def nms(dets, thresh):
    "Dispatch to either CPU or GPU NMS implementations. Accept dets as tensor"""
    dets = dets.cpu().numpy()
    return gpu_nms(dets, thresh)

改成

def nms(dets, thresh):
    "Dispatch to either CPU or GPU NMS implementations. Accept dets as tensor"""
    dets = dets.cpu().numpy()
    return py_cpu_nms(dets, thresh)

注意!以上各函数和库的名字以实际工程中的名字,不同工程不一样,只是提供个思想。
也就是把gpu版本的nms函数换成cpu版本的nms函数

参考资料
https://blog.csdn.net/baishuo8/article/details/88169722

相关文章

网友评论

      本文标题:解决 from lib.nms.gpu_nms import g

      本文链接:https://www.haomeiwen.com/subject/ucsuactx.html