Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

AssertionError: Torch not compiled with CUDA enabled #7

Open
ashwath1295 opened this issue Feb 24, 2022 · 0 comments
Open

AssertionError: Torch not compiled with CUDA enabled #7

ashwath1295 opened this issue Feb 24, 2022 · 0 comments

Comments

@ashwath1295
Copy link

ashwath1295 commented Feb 24, 2022

AssertionError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_18688/1973085970.py in
53
54
---> 55 net = EEGNet().cuda(0)
56 print (net.forward(Variable(torch.Tensor(np.random.rand(1, 1, 120, 64)).cuda(0))))
57 criterion = nn.BCELoss()

~\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py in cuda(self, device)
678 Module: self
679 """
--> 680 return self._apply(lambda t: t.cuda(device))
681
682 def xpu(self: T, device: Optional[Union[int, device]] = None) -> T:

~\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py in _apply(self, fn)
568 def _apply(self, fn):
569 for module in self.children():
--> 570 module._apply(fn)
571
572 def compute_should_use_set_data(tensor, tensor_applied):

~\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py in _apply(self, fn)
591 # with torch.no_grad():
592 with torch.no_grad():
--> 593 param_applied = fn(param)
594 should_use_set_data = compute_should_use_set_data(param, param_applied)
595 if should_use_set_data:

~\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py in (t)
678 Module: self
679 """
--> 680 return self._apply(lambda t: t.cuda(device))
681
682 def xpu(self: T, device: Optional[Union[int, device]] = None) -> T:

~\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\cuda_init_.py in _lazy_init()
206 "multiprocessing, you must use the 'spawn' start method")
207 if not hasattr(torch._C, '_cuda_getDeviceCount'):
--> 208 raise AssertionError("Torch not compiled with CUDA enabled")
209 if _cudart is None:
210 raise AssertionError(

AssertionError: Torch not compiled with CUDA enabled

@ashwath1295 ashwath1295 changed the title SyntaxError AssertionError: Torch not compiled with CUDA enabled Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant