学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

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

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

2、查看cuda版本:nvcc -V

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

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

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

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

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

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.”)

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

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

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

再次运行: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

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

 安装成功!!!

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

学习记录:Windows系统cuda11.6,安装pytorch1.12.0、python3.9

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/04c4ad6a5d.html