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

GAM调用shuffleNet中的channel_shuffle参数有误 #17

Closed
wwwwwbh opened this issue Apr 6, 2022 · 4 comments
Closed

GAM调用shuffleNet中的channel_shuffle参数有误 #17

wwwwwbh opened this issue Apr 6, 2022 · 4 comments
Labels
bug Something isn't working Stale

Comments

@wwwwwbh
Copy link

wwwwwbh commented Apr 6, 2022

def channel_shuffle(self, x, groups=2):
#RESHAPE----->transpose------->Flatten
B, C, H, W = x.shape
out = x.view(B, groups, C // groups, H, W).permute(0, 2, 1, 3, 4).contiguous()
out=out.view(B, C, H, W)
return out

GAM:
x_spatial_att = self.spatial_attention(x).sigmoid()
x_spatial_att=channel_shuffle(x_spatial_att,4)
out = x * x_spatial_att
return out

🐛 Bug

x_spatial_att -> self , x -> int

去掉self能跑起来

@wwwwwbh wwwwwbh added the bug Something isn't working label Apr 6, 2022
@wwwwwbh
Copy link
Author

wwwwwbh commented Apr 6, 2022

x_spatial_att -> self , x -> int

去掉self能跑起来

可以解释清楚一些吗 上面的我没看懂

上面的代码是博主的commom.pyl里的源代码,之前没有调用channel_shuffle的,现在多调用了这个函数,我的意思他这里调用时候,s_spatial_att作为self传入了函数,group数作为tensor传入了函数,

@positive666
Copy link
Owner

x_spatial_att -> self , x -> int
去掉self能跑起来
可以解释清楚一些吗 上面的我没看懂

上面的代码是博主的commom.pyl里的源代码,之前没有调用channel_shuffle的,现在多调用了这个函数,我的意思他这里调用时候,s_spatial_att作为self传入了函数,group数作为tensor传入了函数,

感谢反馈 最近在休假 是我的低级错误 因为本地是没问题的 所以GIT的有时候没去验证 我会合并最新的改动 整理更新一下

@positive666
Copy link
Owner

x_spatial_att -> self , x -> int
去掉self能跑起来
可以解释清楚一些吗 上面的我没看懂

上面的代码是博主的commom.pyl里的源代码,之前没有调用channel_shuffle的,现在多调用了这个函数,我的意思他这里调用时候,s_spatial_att作为self传入了函数,group数作为tensor传入了函数,

嗯确实 因为整理GIT版本时候,直接把shufflenetv2定义的类函数通道混洗拿上去了 已经修复

@github-actions
Copy link

github-actions bot commented Jul 7, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants