记录学习过程:在Windows系统中安装CUDA 11.6、PyTorch 1.12.0和Python 3.9

1、查看显卡相关信息:nvidia-smi。显卡版本531.18,最大可以安装cuda12.1版本,安装步骤上一篇博客讲解过。

2、查看cuda版本:nvcc -V

3、查看anaconda是否安装:conda -V

4、查询cuda11.6对应的pytorch版本:https://pytorch.org/get-started/previous-versions/

显示对应的pytorch1.12.0、1.12.1,接着查询适合的python版本3.7、3.8、3.9、3.10

5、创建环境,安装pytorch1.12.0 、python3.9

conda create -n learn python==3.9
conda activate learn
# CUDA 11.6
pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116

在安装numpy处出现raise ReadTimeoutError(self._pool, None, "Read timed out.")

先单独安装numpy:pip3 install numpy==1.22.4 scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple

再次运行:pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 –extra-index-url https://download.pytorch.org/whl/cu116

 安装成功!!!

6、测试pytorch是否安装成功,安装成功

物联沃分享整理
物联沃-IOTWORD物联网 » 记录学习过程:在Windows系统中安装CUDA 11.6、PyTorch 1.12.0和Python 3.9

发表评论