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

AssertionError: Torch not compiled with CUDA enabled #7

@ashwath1295

Description

@ashwath1295

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions