当前位置:网站首页>Run Yolo v5-5.0 and report an error. If the sppf error cannot be found, solve it
Run Yolo v5-5.0 and report an error. If the sppf error cannot be found, solve it
2022-07-07 17:41:00 【AI cannon fodder】
First find yolov5 Below models Under the folder common.py file , As shown below :
Find the folder below SPP class ,
Then add SPPF class , As shown below ,
class SPPF(nn.Module):
def __init__(self, c1, c2, k = 5):
super().__init__()
c_ = c1 // 2
self.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')
y1 = self.m(x)
y2 = self.m(y1)
return self.cv2(torch.cat([x, y1, y2, self.m(y2)], 1))
You can directly copy the above code . Then the error is resolved .
边栏推荐
猜你喜欢
随机推荐
Functions and usage of imageswitch
js拉下帷幕js特效显示层
Simple loading animation
线上比赛相关规则补充说明
Mysql 索引命中级别分析
Actionbar navigation bar learning
网络攻防复习篇
mui侧边导航锚点定位js特效
机器人工程终身学习和工作计划-2022-
Use seven methods to enhance all the images in a folder
百度地图自定义样式向右拖拽导致全球地图经度0度无法正常显示
Devops' operational and commercial benefits Guide
目标管理【管理学之十四】
到底有多二(Lua)
【TPM2.0原理及应用指南】 12、13、14章
Functions and usage of viewswitch
L1-025 正整数A+B(Lua)
LeetCode 497(C#)
【信息安全法律法规】复习篇
What is agile testing