安装步骤:
一、annaconda3搭建虚拟环境
1、Anaconda Prompt命令行输入:
conda create -n torch-cpu1.4 python==3.6.5
2、激活环境:
conda activate torch-cpu1.4
二、pip安装:
1、安装基础包
pip install numpy
pip install pillow
2、pytorch1.4-cpu+torchvision 0.5.0+cpu
pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
3、查看已安装包
(torch-cpu1.4) C:\Users\XXXX>pip list
Package Version
------------ ---------
certifi 2016.2.28
numpy 1.19.5
Pillow 8.4.0
pip 21.3.1
setuptools 36.4.0
wheel 0.29.0
wincertstore 0.2
4、验证torch是否安装上
(torch-cpu1.4) C:\Users\XXXX>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.4.0+cpu'
>>>
|