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

部分模块在使用GPU计算时报错(Most modules report errors when using GPU) #94

Open
ImcwjHere opened this issue Nov 20, 2022 · 2 comments

Comments

@ImcwjHere
Copy link

报错内容类似于:
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same
或者
Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper__index_select)

修复方案:
将list修改为modulelist
如model/mlp/mlp_mixer.py文件中(49行):
将self.mlp_blocks=[]修改为self.mlp_blocks=nn.ModuleList([])

@ImcwjHere ImcwjHere changed the title 大部分模块在使用GPU计算时报错(Most modules report errors when using GPU) 部分模块在使用GPU计算时报错(Most modules report errors when using GPU) Nov 20, 2022
@zeng-cy
Copy link

zeng-cy commented Dec 2, 2022

改了还是不行

@daviscsuft
Copy link

请问还有别的方法吗,ccnet里没有list

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

3 participants