小编AFB*_*AFB的帖子

运行时错误:没有可用的 CUDA GPU

我想在我的笔记本电脑中训练 gpt2 模型,并且我的笔记本电脑中有一个 GPU,我的操作系统是 windows ,但我总是在 python 中遇到此错误:

torch._C._cuda_init()
RuntimeError: No CUDA GPUs are available
Run Code Online (Sandbox Code Playgroud)

当我尝试在 python 控制台中检查 GPU 的可用性时,我得到了答案:

import torch
torch.cuda.is_available()
Out[4]: True
Run Code Online (Sandbox Code Playgroud)

但我无法获取版本

nvcc version 
#or  nvcc --version
NameError: name 'nvcc' is not defined
Run Code Online (Sandbox Code Playgroud)

我使用这个命令来安装CUDA

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch  
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能让 GPU 可用于 python?

python gpu anaconda pytorch

5
推荐指数
1
解决办法
4万
查看次数

标签 统计

anaconda ×1

gpu ×1

python ×1

pytorch ×1