AttributeError: Cant get attribute SPPF on module models
运行YOLOV5出现报错AttributeError: Can't get attribute 'SPPF'
问题
AttributeError: Can't get attribute 'SPPF'
运行yolov5下面Tags5的代码出现问题:
AttributeError: Cant get attribute SPPF on module models
搞了很久,最终得到解决方案,特此公布给遇到同样问题的人。
运行的是yolov5 Tags5的代码,出现了这个报错:
解决方案
- 到Tags6里面的
model/common.py
里面去找到这个SPPF的类,把它拷过来到Tags5的model/common.py
里面,这样你的代码就也有这个类了,还要引入一个warnings
包
如果找不到SPPF这个类,那我现在直接粘贴在这里,你们只需要复制到你们的common.py
里面即可,记得把import warnings放在上面去
import warningsclass SPPF(nn.Module):# Spatial Pyramid Pooling - Fast (SPPF) layer for YOLOv5 by Glenn Jocherdef __init__(self, c1, c2, k=5): # equivalent to SPP(k=(5, 9, 13))super().__init__()c_ = c1 // 2 # hidden channelsself.cv1 = Conv(c1, c_, 1, 1)self.cv2 = Conv(c_ * 4, c2, 1, 1)self.m = nn.MaxPool2d(kernel_size=k, stride=1, padding=k // 2)def forward(self, x):x = self.cv1(x)with warnings.catch_warnings():warnings.simplefilter('ignore') # suppress torch 1.9.0 max_pool2d() warningy1 = self.m(x)y2 = self.m(y1)return self.cv2(torch.cat([x, y1, y2, self.m(y2)], 1))
AttributeError: Cant get attribute SPPF on module models相关推荐
- 解决YOLO v5的AttributeError: Can‘t get attribute SPPF on module models. common的问题
** 目录 一.问题描述 二.解决方法 三.参考来源 一.问题描述 在运行YOLOv5的detect.py程序时候,出现了以下错误提示AttributeError: Can't get attribu ...
- AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘D:\\ModelTest\\yolov5-5
记录一下这个错误: AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from 'D:\\ModelTe ...
- 运行yolov5-5.0出现AttributeError: Can‘t get attribute ‘SPPF‘ 正确解决方法
运行yolov5旧版本代码(比如5.0版本)出现错误 AttributeError: Can't get attribute 'SPPF' on <module 'models.common' ...
- yolov5_6.0以上的模型和6.0以下的模型不兼容问题。Can‘t get attribute ‘SPPF‘
yolov5_6.0以上的模型和6.0以下的模型不兼容问题: [完全解决yolov5权重6.0与之前版本不兼容问题]Can't get attribute 'SPPF' on emodule 'mod ...
- AttributeError: Can‘t get attribute ‘SPPF‘
1.环境:训练自己的YOLOv5-5.0模型. 2.报错原因:预训练权重的版本与源码框架不匹配,在下面的网站中找到对应的YOLOv5-5.0的版本: Releases · ultralytics/yo ...
- AttributeError: Can‘t get attribute ‘Net‘ on module ‘__main__‘
在使用pytorch深度学习框架的时候,我们加载预先训练好的完整pkl模型时,如果报错: AttributeError: Can't get attribute 'Net' on module '__ ...
- Can't get attribute '_rebuild_tensor_v2' on module 'torch._utils'
Can't get attribute '_rebuild_tensor_v2' on <module 'torch._utils' pip uninstall torch 会把0.1.2版本也 ...
- gensim : AttributeError: The vocab attribute was removed from KeyedVector in Gensim 4.0.0.
gensim报错:AttributeError: The vocab attribute was removed from KeyedVector in Gensim 4.0.0. Use Keyed ...
- openpyxl:AttributeError: ‘MergedCell’ object attribute ‘value’ is read-only
openpyxl:AttributeError: 'MergedCell' object attribute 'value' is read-only 使用openpyxl向excel写入数据时,报了 ...
最新文章
- UVA 11752 超级幂
- 使用resnet训练CIFAR10
- 以python入门教程新世界-Python打开新世界的大门-入门篇1
- C#委托及事件 详解(讲得比较透彻)
- Python下opencv使用笔记系列
- Sicily 1155. Can I Post the lette
- 苹果CMS V10 播放记录_苹果cms整合dplayer播放器增加记忆+P2P播放+自动下一集
- C++对象产生和销毁的顺序
- IE8 -- 此网页上的问题导致 Internet explore 关闭并重新打开该选项卡
- 10月24日杨力祥老师谈话有感[转]
- 18位华人当选2022年加拿大工程院院士!京东副总裁梅涛入选!
- mysql 启动 配置文件,mysql启动服务配置文件编写
- vb连接mysql教程视频_VB连接MYSQL数据的方法
- 【Python练习】乌龟吃鱼小游戏
- c语言函数大全表格形式,C语言函数大全[表格形式].doc
- 暴露在公网环境下主机的安全防护
- CC3200使用MQTT协议连接Onenet平台实践
- 思考如何概括“技术美术”(Technical Artist)的职责
- 8、springboot-获取客户端Ip地址
- 数据库原理作业3 — JMU