美文网首页
安装pytorch

安装pytorch

作者: 京漂的小程序媛儿 | 来源:发表于2019-11-25 19:57 被阅读0次

pytorch官网

https://pytorch.org/

根据官网提示安装,选择pip方式安装即可(因为conda方式,切换到清华镜像也下载不下来)

安装

注:

1、一定安装本机cuda对应的版本,否则GPU用不了。

我本机的CUDA是10.0版本,安装命令是

pip install torch==1.3.0+cu100 torchvision==0.4.1+cu100 -f https://download.pytorch.org/whl/torch_stable.html

torch的稳定版本 torchvision的稳定版本

https://download.pytorch.org/whl/torch_stable.html是必须的,国内可访问。

用命令torch.cuda.is_available()查看版本是否正确。

安装成功

上图显示,gpu可用。下图说明没安装正确版本,gpu不可用

版本安装不正确,gpu不可用

相关文章

网友评论

      本文标题:安装pytorch

      本文链接:https://www.haomeiwen.com/subject/rzojwctx.html