最近自己在搞YOLOv5目标检测学习,对模型的搭建遇到了很多问题,查看了很多资料,经过一些大神的回答,这个模型终于是跑起来了。把自己的错误总结整理一下。
错误一:
AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from 'F:\\YOLO-V5\\yolov5-5.0\\models\\common.py'>
改正:
你去他的6.0版本的moudle里把SPPFF类复制到你的5.0里 或者
class SPPF(nn.Module):
# export-friendly version of nn.SiLU()
@staticmethod
def forward(x):
return x * torch.sigmoid(x) 这段加到models的common
错误二;
DistributionNotFound: The 'pycocotools>=2.0' distribution was not found and is required by the application
改正 :
安装包https://pan.baidu.com/s/1nWQdPRtGwNnOO2DkxRuGuA提取码:i5d7
安装完直接解压复制其中pycocotools两个文件夹到conda环境…\Lib\site-packages之