python安装torch的详细步骤(亲测成功)

1 问题:跑程序过程中需要安装torchvision
运行窗口输入cmd
输入pip install torchvision -i https://pypi.doubanio.com/simple后显示我的torch版本太低。

2 重新安装torch==1.4.0版本
在运行窗口打开自己的要安装的环境,
pip install torch==1.4.0 -i https://pypi.doubanio.com/simple一直装不上。
在这里插入图片描述
3.先去网站下载torch,再安装。

https://download.pytorch.org/whl/torch_stable.html
打开上面地址,找到自己要下的版本,我是windows系统,python3.6,装的cpu版本torch==1.4.0,
所以我选择这个—cpu/torch-1.4.0%2Bcpu-cp36-cp36m-win_amd64.whl,我下载到桌面。
(你根据自己的需求取下载)

python安装torch的详细步骤(亲测成功)_第1张图片
4.直接安装torch==1.4.0

下载到桌面后(大约半小时内)
运行窗口输入cmd
activate pytorch_env (就是用activate打开自己的环境)
cd Desktop (打开下载文件的地址)
pip install torch-1.4.0+cpu-cp36-cp36m-win_amd64.whl (直接安装)
torch==1.4.0安装成功
python安装torch的详细步骤(亲测成功)_第2张图片
5.安装torchvision
pip install torchvision -i https://pypi.doubanio.com/simple
安装成功
python安装torch的详细步骤(亲测成功)_第3张图片

你可能感兴趣的:(python,pytorch)