AssertionError: Torch not compiled with CUDA enabled
时间: 2023-10-13 19:22:32 浏览: 55
This error message indicates that PyTorch is not configured to use CUDA, which is a parallel computing platform used to accelerate deep learning training and inference on NVIDIA GPUs.
To resolve this issue, you need to install the appropriate version of PyTorch with CUDA support. You can check the CUDA version supported by your GPU and download the corresponding PyTorch version from the official PyTorch website.
Alternatively, you can install PyTorch with CUDA support using the following command:
```
pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/cu111/torch_stable.html
```
This command installs the latest version of PyTorch with CUDA 11.1 support.
After installing PyTorch with CUDA support, you can verify if it is working by running the following command:
```
import torch
print(torch.cuda.is_available())
```
If the output is `True`, then PyTorch is configured to use CUDA and you can start using GPU acceleration for your deep learning tasks.
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)