Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在yolov5中加入了CloAttention注意力机制报错 #40

Open
zqrxiaer opened this issue Feb 2, 2024 · 0 comments
Open

在yolov5中加入了CloAttention注意力机制报错 #40

zqrxiaer opened this issue Feb 2, 2024 · 0 comments

Comments

@zqrxiaer
Copy link

zqrxiaer commented Feb 2, 2024

我用的是YOLOv5s模型为基础,在backbone第九层加入了CloAttention,照着视频里的做法,修改了yolo.py文件,但是训练的时候报错:
"RuntimeError: shape '[28, 2, -1, 64, 24]' is invalid for input of size 286720"
错误发生在第77行:
“kv = to_kv(kv).view(b, 2, -1, self.dim_head, (h*w)//(self.window_size**2)).permute(1, 0, 2, 4, 3).contiguous() #(2 b m (H W) d)”
是维度错误,每一轮训练结束后的验证阶段开始的时候报错.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant