赞
踩
指定虚拟环境名称(conda create -n xxxx)和python版本(python=x.x)
conda create -n mypytorch python=3.9
直接进NVIDIA官网:NVIDIA GeForce 驱动程序 - N 卡驱动 | NVIDIA
- conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
-
-
- conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
-
-
- conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
-
-
- conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
-
-
- conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/
conda install cudnn
(安装cuDNN的同时,conda会安装对应版本的CUDA)
conda list
在Pytorch官网中选择对应版本,
红框显示先前版本,我的是cuda 11.1,寻找对应版本的cuda
复制到命令窗口
下载
问题
ERROR: No matching distribution found for torchyision==0.11.2+cu111
换一个CUDA11.1:
- pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
-
在python检验pytorch是否可用
- import torch
-
- print(torch.__version__) #查看pytorch版本
-
- print(torch.cuda.is_available()) #查看cuda是否可用 输出为True 或者False
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。