动手学深度学习-Note1-环境配置

环境配置

anaconda安装

CPU版本pytorch

1)创建虚拟环境

conda create -n d2l-zh python=3.8

2)安装

pip install jupyter d2l torch torchvision

GPU版本pytorch

cuda与torch对应关系:https://pytorch.org/get-started/previous-versions/
cuda 10.0

conda create -n d2l-zh-gpu python=3.7
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
pip install jupyter d2l

手动下载pytorch

官方安装包下载地址

清华镜像安装包下载地址

pytorch手动安装开发包

测试安装

进入Python环境

>>> import torch
>>> torch.__version__
'1.2.0'
>>> torch.cuda.is_available()
True

猜你喜欢

转载自blog.csdn.net/CesareBorgia/article/details/117963509