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

Why does it keep reporting this error?“AssertionError: Torch not compiled with CUDA enabled” #28

Closed
leelbc opened this issue Sep 6, 2021 · 4 comments

Comments

@leelbc
Copy link

leelbc commented Sep 6, 2021

Traceback (most recent call last):
File "E:/_BACKUP/lbc/pytorch-wgan-master/main.py", line 45, in
main(args)
File "E:/BACKUP/lbc/pytorch-wgan-master/main.py", line 33, in main
model.train(train_loader)
File "E:_BACKUP\lbc\pytorch-wgan-master\models\dcgan.py", line 226, in train
z = Variable(torch.randn(self.batch_size, 100, 1, 1).cuda(self.cuda_index))
File "E:\anaconda\envs\pytorch-wgan-master\lib\site-packages\torch\cuda_init
.py", line 164, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

Process finished with exit code 1

@leelbc
Copy link
Author

leelbc commented Sep 6, 2021

I installed cuda10.2 and cudnn7.6.5 for this virtual environment

@Zeleni9
Copy link
Owner

Zeleni9 commented Sep 6, 2021

Go on Pytorch website pip install torch with CUDA 10.2 version and it should work.

@Zeleni9 Zeleni9 closed this as completed Sep 6, 2021
@leelbc
Copy link
Author

leelbc commented Sep 7, 2021

ok, Thanks for the reminder, I can already run it, but according to the prompt I am using gpu for training, but the computer's resource manager shows 100% cpu usage, I am still checking the problem

@Zeleni9
Copy link
Owner

Zeleni9 commented Sep 7, 2021

Did u try running $ nvidia-smi command ? Or check torch using this commands: Check torch GPU. If u have cuda 10.2 that version check on pytorch website and install or reinstall cuda.

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