当前位置:网站首页>yolov5训练自己的数据集报错记录
yolov5训练自己的数据集报错记录
2022-06-21 17:51:00 【Scarlett2025】
AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from 'E:\\my_yolov5-5.0\\models\\common.py'>
在项目的common.py下加入以下代码
import warnings
class SPPF(nn.Module):
# Spatial Pyramid Pooling - Fast (SPPF) layer for YOLOv5 by Glenn Jocher
def __init__(self, c1, c2, k=5): # equivalent to SPP(k=(5, 9, 13))
super().__init__()
c_ = c1 // 2 # hidden channels
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') # suppress torch 1.9.0 max_pool2d() warning
y1 = self.m(x)
y2 = self.m(y1)
return self.cv2(torch.cat([x, y1, y2, self.m(y2)], 1)) 
RuntimeError: Given groups=1, weight of size [512, 1024, 1, 1], expected input[1, 512, 8, 8] to have 1024 channels, but got 512 channels instead

运行train.py文件时出现上面的错误,指定默认的模型yaml文件的路径地址
AssertionError: Image Not Found
修改utils/datasets.py
按住ctrl+g快速定位到124行,
把p = str(Path(path).absolute())改成p = str(Path(path))
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at
C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\TensorShape.cpp:2228.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]

按照提示的路径打开functional.py,Ctrl+G快速定位到568行,修改为下图所示。
边栏推荐
- JDBC编程六步
- 南信大2020-2021第一学期FPGA/CPLD期末试卷
- Fpga/cpld final examination paper for the first semester of Nanjing University of information technology 2020-2021
- 力扣每日一练之双指针1Day8
- WWDC22 多媒体特性汇总
- Is there a Hongmeng version of the song ordering system? Lao Wang was the first to experience it
- 2022中国眼博会,山东青少年眼睛健康展,视力矫正与康复展
- Gartner 网络研讨会 “九问数字化转型” 会后感
- 11 brève introduction et installation de la Bibliothèque d'analyse de soup beautiful
- 36 krypton launched | focusing on the innovation of health insurance products, and "Yingshi health" has obtained four rounds of financing
猜你喜欢

50位中国女性科学家入选2022福布斯

【一起上水硕系列】Day One

vivo 容器集群监控系统架构与实践

牛客网:归并两个有序的数组

Servlet specification (I)

After Hongmeng, Huawei announced that it would donate to Euler again. What impact is expected to be brought to the industry by the donations of Hongmeng and Euler?

Insert class collation

Huawei launches new products again? These models have excellent functions

Threejs aircraft Earth 3D scene animation

JDBC编程六步
随机推荐
昇腾科研创新使能计划赋能开发者&nbsp; 华为计算提供三大维度支持
VsCode自定义模板,用模板记笔记?!
Explanation of El table paging select all function
阿里云yum源配置
R语言glm函数构建二分类logistic回归模型(family参数为binomial)、使用coef函数获取模型系数并解析系数意义
企评家全面解读:【国家电网】中国电力财务有限公司企业成长性
华为又发新品?这几款功能太优秀了
Easy introduction to naturallanguageprocessing series topic 6 code practice -- spelling correction based on language model
Book at the end of the article | new work by teacher Li Hang! A new upgrade of the classic machine learning work statistical learning methods
50位中国女性科学家入选2022福布斯
Day11QPainter2021-09-26
11 Beautiful Soup 解析庫的簡介及安裝
Equals null pointer exception
MarkDown初级语法一文精通,兼容MarkText
Listener and filter (monitor and interceptor) in Servlet
删除指定的screen
Gartner 网络研讨会 “九问数字化转型” 会后感
After Hongmeng, Huawei announced that it would donate to Euler again. What impact is expected to be brought to the industry by the donations of Hongmeng and Euler?
Servlet规范(一)
Canvas dynamic background text luminous JS effect