1、 pytorch linux 下的安装教程
https://blog.csdn.net/xiangyuel/article/details/94969820?utm_medium=distribute.pc_relevant.none-task-blog-baidujs-1
2、 下载地址,版本对应
torch, torchivision, 版本对应
torch, https://pypi.org/project/torch/1.5.0/#files,找到需要的版本下载
torchvision , https://pypi.org/project/torchvision/#files ,安装包下载地址
下载后用 pip install 安装
下载包一定要知道对应关系,版本 torch torchvision , 查看两个包的发布时间,
pip 安装自动匹配版本关系,知道版本对应
pip install torch-1.5.0-cp36-cp36m-manylinux1_x86_64.whl ,
pip install torchvision-0.6.0-cp36-cp36m-manylinux1_x86_64.whl 这是对应的
torchvision 可以早发布早几天
3、上述吭哧吭哧搞定,发现不能GPU 训练,原来上述都是cpu 版本的离线安装,重要事情说三遍:cpu软件包,不是gpu软件包,gpu软件包下载长这样
torch.cuda.device_count() 一直0
torch.cuda.is_available()返回false
https://download.pytorch.org/whl/torch_stable.html
官网地址,找到 cu开头的包,就是cuda,
下载的界面如下,版本的选择按照第2个步骤发布日期 选择对应版本即可,
下载结束直接pip install 安装包, 如果没有版本问题,马上就会显示 Successfully 信息
3.1 tensorflow-gpu 离线安装
离线包是这个 带有gpu ,torch是 torch-1.4.0+cu100-cp36-cp36m-linux_x86_64,搜索美誉gpu版本 tensorflow-gpu搜索是有的
tensorflow_gpu-1.14.0-cp36-cp36m-manylinux1_x86_64.whl
下载地址 直接搜索 tensorflow-gpu
https://pypi.org/project/tensorflow-gpu/1.14.0/