You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
报错内容类似于:
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)
The text was updated successfully, but these errors were encountered:
ImcwjHere
changed the title
大部分模块在使用GPU计算时报错(Most modules report errors when using GPU)
部分模块在使用GPU计算时报错(Most modules report errors when using GPU)
Nov 20, 2022
报错内容类似于:
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([])
The text was updated successfully, but these errors were encountered: