赞
踩
最近因为项目的原因,要使用检测斜框的模型,就学习了一下yolov5-obb。
当然,在配置环境和使用时也是遇到了许多问题,记下了一些认为比较重要的,
使用的代码是这个大佬的:https://github.com/hukaixuan19970627/yolov5_obb
原因:np.int在NumPy 1.20中已弃用,在NumPy 1.24中已删除。
解决方式:把有报错的文件里的np.int更改为np.int_。。或者改成int也是可以
解决方法:修改【utils】中的【loss.py】里面的两处内容
1)打开你的【utils】文件下的【loss.py】
2)按【Ctrl】+【F】打开搜索功能,输入【for i in range(self.nl)】找到后将anchors = self.anchors[i]替换为 anchors, shape = self.anchors[i], p[i].shape。输入【indices.append】找到下面的一行内容: 替换为以下内容indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1))) # image, anchor, grid
解决方法:在nms_rotated_wrapper.py中把ori_inds = torch.arange(dets_th.size(0)) # 0 ~ n-1
替换为ori_inds = torch.arange(dets_th.size(0)).to('cuda') # 0 ~ n-1。即把数据也放到GPU中
原因:安装了新版本的Pillow。
解决方法:降到9.5即可----pip install Pillow==9.5
原因:下载yolov5x.pt这个权重文件的时候没有下载完。
解决方法:可以自己手动下载,下载完即可。
解决方法:将DOTA_devkit-master文件夹根目录的polyiou.cpp
用Notepad打开,然后将编码改为UTF-8 带BOM格式,再重新执行之前的代码就OK。
记录的就暂时只有这些,如果有其它的问题,可以去开头的github链接中的issue中查找遇到的问题。
笔者也是小白一枚,有错误欢迎指正.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。