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

没有cuda #61

Open
YangFW opened this issue May 10, 2022 · 6 comments
Open

没有cuda #61

YangFW opened this issue May 10, 2022 · 6 comments
Assignees
Labels
fix bug fix good first issue Good for newcomers

Comments

@YangFW
Copy link

YangFW commented May 10, 2022

没有安装cuda,如何调用cpu训练,现在报如下错误:
AssertionError: Torch not compiled with CUDA enabled

@YangFW
Copy link
Author

YangFW commented May 10, 2022

模型设置时不带device参数,或者直接设置为None,训练时都报上述同样的错
model = Task(dl_module, optimizer, CasRelLoss(),device=None)

@xiangking
Copy link
Owner

您好,需要设置device="cpu",设置为None时会去检测环境自动选择

@YangFW
Copy link
Author

YangFW commented May 10, 2022

我这样设置过,也是报同样的错误,定位到的报错位置是这样的
image
为什么都设置了cpu,还会去调用torch.cuda.Stream(),难道需要我安装pytorch 的gpu版本吗?

@xiangking
Copy link
Owner

casrel的代码吗,这部分确实存在这个问题,为了速度,所以设置了torch.cuda.Stream

@YangFW
Copy link
Author

YangFW commented May 10, 2022

casrel的代码吗,这部分确实存在这个问题,为了速度,所以设置了torch.cuda.Stream

对,是的,那目前我没有显卡的情况下,还能用这块的函数吗,还是必须要换掉?
PRGC 的有这个问题吗

@xiangking
Copy link
Owner

PRGC没用到这部分代码应该是可以,casrel后续我们会对该问题进行优化

@xiangking xiangking added good first issue Good for newcomers fix bug fix labels May 10, 2022
@xiangking xiangking self-assigned this May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix bug fix good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants