赞
踩
- (env1_yolov5) E:\PY\YOLOV5\yolov5-6.0>pip install torch==1.10.1+cu102 torchvision==0.11.2+cu102 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html
- Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
- Looking in links: https://download.pytorch.org/whl/torch_stable.html
- Collecting torch==1.10.1+cu102
- Downloading https://download.pytorch.org/whl/cu102/torch-1.10.1%2Bcu102-cp39-cp39-win_amd64.whl (1485.9 MB)
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 GB 3.4 MB/s eta 0:00:00
- Collecting torchvision==0.11.2+cu102
- Downloading https://download.pytorch.org/whl/cu102/torchvision-0.11.2%2Bcu102-cp39-cp39-win_amd64.whl (2.6 MB)
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.6/2.6 MB 4.1 MB/s eta 0:00:00
- Collecting torchaudio==0.10.1
- Downloading https://download.pytorch.org/whl/cu113/torchaudio-0.10.1%2Bcu113-cp39-cp39-win_amd64.whl (336 kB)
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 336.6/336.6 KB 6.9 MB/s eta 0:00:00
- Requirement already satisfied: typing-extensions in e:\anaconda3\envs\env1_yolov5\lib\site-packages (from torch==1.10.1+cu102) (4.1.1)
- Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in e:\anaconda3\envs\env1_yolov5\lib\site-packages (from torchvision==0.11.2+cu102) (9.1.0)
- Requirement already satisfied: numpy in e:\anaconda3\envs\env1_yolov5\lib\site-packages (from torchvision==0.11.2+cu102) (1.22.3)
- Installing collected packages: torch, torchvision, torchaudio
- Attempting uninstall: torch
- Found existing installation: torch 1.11.0
- Uninstalling torch-1.11.0:
- Successfully uninstalled torch-1.11.0
- Attempting uninstall: torchvision
- Found existing installation: torchvision 0.12.0
- Uninstalling torchvision-0.12.0:
- Successfully uninstalled torchvision-0.12.0
- Attempting uninstall: torchaudio
- Found existing installation: torchaudio 0.11.0+cu113
- Uninstalling torchaudio-0.11.0+cu113:
- Successfully uninstalled torchaudio-0.11.0+cu113
- Successfully installed torch-1.10.1+cu102 torchaudio-0.10.1+cu113 torchvision-0.11.2+cu102
-
- (env1_yolov5) E:\PY\YOLOV5\yolov5-6.0>python
- Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import torch
- >>> torch.__version__
- '1.10.1+cu102'
- >>> torch.cuda.is_available()
- True
1.1 Version是windows系统,选择win10
1.2 exe(local)是完全离线安装包,可以复制链接用迅雷下载,速度很快.如果选择(network)的话会安装到一半再网上下载,可能速度很慢.
1.3 点击安装包后的第一个弹窗,建议在其他盘新建一个空文件夹,安装结束后会自动删除掉
1.4 记住安装位置,后面需要将文件放入,最好使用默认位置.
1.5 出现图形程序问题不用担心,因为图形程序版本高能兼容低版本Cuda.
(1条消息) nvidia驱动,cuda与cudnn的关系_「已注销」的博客-CSDN博客_cuda和nvidia驱动的关系
1.6 按照教程设置系统变量(按照教程一步步来,该重启就重启,保险一点!)
2.1 按照Cuda版本选择cuDNN, 不要被显卡程序里面的Cuda.dll和nvidia-sim显示的版本误导了,版本号从nvcc -V/安装包截图/安装路径 确定!
2.2 移动文件夹,其中lib文件夹中有两个子文件夹,不用担心,直接放在lib下就可以,重要的是后面添加path环境变量(我不知道父文件夹和两个子文件夹都复制了一份)
2.3 按照教程将上面三个文件夹添加进path环境变量
4.1 进入pycharm,进入环境
4.2 进入Previous PyTorch Versions | PyTorch,直接找到轮子-对应cuda版本,复制命令,
在pycharm中粘贴运行.
4.3 运行命令,检查是否可用
- >>> import torch
- >>> torch.__version__
- '1.10.1+cu102'
- >>> torch.cuda.is_available()
- True
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。