Torch和torchvision的安装

您所在的位置:网站首页 torch下载完import不了 Torch和torchvision的安装

Torch和torchvision的安装

2024-06-26 23:42| 来源: 网络整理| 查看: 265

叮~ 快收藏torch和torchvision的详细安装步骤~~~~~

要安装torch和torchvision,首先要确定你电脑安装的python的版本,而且还要知道torch和torchvision的版本对应

即:torch - torchvision - python版本的对应关系(网上一搜一大把)

一. torch的安装步骤

1. 先查看python的版本,方法是Windows+R,输入cmd,打开命令提示符,输入python,即可查看python的版本

 2. 根据python版本下载torch和torchvision,例如我电脑安装python的版本是3.9,我下载的torch和torchvision版本如下(大家一定选取适合自己python版本的torch和torchvision进行安装)

(torch和torchvision下载网址:https://download.pytorch.org/whl/torch_stable.html)

​​​​​​​

 

 3. torch和torchvision下载好之后,就可以开始安装了cpu/torchvision-0.10.0%2Bcpu-cp39-cp39-win_amd64.whl

还是在命令提示符上进行安装,安装前要知道下载的torch和torchvision的位置,首先进入到该目录下,在进行命令安装,还是以我3.9的python版本为例,

安装torch:pip install torch-1.9.1+cpu-cp39-cp39-win_amd64.whl

安装torchvision:pip torchvision-0.10.0%2Bcpu-cp39-cp39-win_amd64.whl

 

 

 (上图红色方框内是安装命令,箭头所指是安装成功的标志)

​​​​​​​



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3