我对深度学习的理解有限,所以希望通过PyTorch来学习。我更喜欢从旧版本的 PyTorch 开始。
我在 Windows 11 上下载并安装了
CUDA 9.2
,我的 CUDA 驱动程序版本是 CUDA 12.1
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:08:12_Central_Daylight_Time_2018
Cuda compilation tools, release 9.2, V9.2.148
最初,我尝试使用以下命令安装
PyTorch 0.4.1
和 CUDA 9.2
:
conda install pytorch=0.4.1 cuda92 -c pytorch
输出是:
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- pytorch=0.4.1*
无法通过 Conda 解决此问题,我选择了手动安装。 随后,我从
https://download.pytorch.org/whl/torch_stable.html.
下载了
torch-0.4.1-cp36-cp36m-linux_x86_64.whl
的轮子文件 CUDA 9.2
我使用
Python 3.6.5
创建了 Conda 环境并安装了 cudatoolkit 9.2
。
但是,当我运行以下代码时:
import torch
print("PyTorch Version:", torch.__version__)
print("CUDA Available:", torch.cuda.is_available())
print("CUDA Version:", torch.version.cuda if torch.cuda.is_available() else "N/A")
输出是:
PyTorch Version: 0.4.1
CUDA Available: False
CUDA Version: N/A
我在网上找了好久。但没有用。请帮忙或尝试给出一些如何实现这一目标的想法。
我第一次在 Stack Overflow 上问问题。如果我无心冒犯了任何人,我真诚地提前道歉。