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

train不过 #15

Open
heham opened this issue Mar 7, 2022 · 4 comments
Open

train不过 #15

heham opened this issue Mar 7, 2022 · 4 comments

Comments

@heham
Copy link

heham commented Mar 7, 2022

win下操作的,python版本3.9.10,安装库都顺利,到了train就不过,看着像是显卡加速的问题,我是amd的apu,要怎么不使用cuda只使用cpu?
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

@heham
Copy link
Author

heham commented Mar 7, 2022

尝试修改 device = torch.device("cuda")为device = torch.device("cpu")之后出现RuntimeError: expected scalar type Long but found Int,loss = criterion(outputs, labels)

@heham
Copy link
Author

heham commented Aug 10, 2022

尝试修改 device = torch.device("cuda")为device = torch.device("cpu")之后出现RuntimeError: expected scalar type Long but found Int,loss = criterion(outputs, labels)

169行上面增加labels = labels.to(torch.long)

@heham
Copy link
Author

heham commented Aug 10, 2022

不知道怎么搞了,改了之后训练是通过了,但是识别不正确

@Blacksnow123
Copy link

改下evaluate.py里面的cuda改成cpu就好了

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

2 participants