AttributeError: module ‘torch.nn‘ has no attribute ‘SiLU‘问题的解决办法
错误:AttributeError: module ‘torch.nn’ has no attribute ‘SiLU’
错误原因:这个版本的torch中的torch.nn函数表里面没有这个SiLU函数,需要更高版本的torch,在官方的文档中我们就可以查看这个版本里有没有包含这个模块。官方文档(1.7.0)

可以看到1.7.0的pytorch有silu
根据相应需求更改pytorch版本
博客指出出现AttributeError: module ‘torch.nn’ has no attribute ‘SiLU’错误,原因是当前版本torch的nn函数表中无SiLU函数,需更高版本。可查看官方文档确定版本,如1.7.0的pytorch有silu,可按需更改版本。
1万+

被折叠的 条评论
为什么被折叠?



