【学习pytorch 01】Jupyter notebook+云GPU的使用

一、下载pytorch

首先,得把pytorch下载了,在Anaconda Prompt中输入在pytorch官网复制的下载命令:

【学习pytorch 01】Jupyter notebook+云GPU的使用_第1张图片

回车就行 

验证是否安装成功:

在cmd输入python 回车

再输入import torch 回车

没问题就成功。

如果有问题,打开Anaconda Prompt,输入conda install nb_conda  (漫长等待)

再输入conda install ipykernel回车,遇到安装提示输入y 

不用管jupyter notebook 有没有出现pytorch,只要import torch没报错就行【学习pytorch 01】Jupyter notebook+云GPU的使用_第2张图片

 

 

二、使用Jupyter notebook打开本地文件

jupyter notebook下在c盘,打开后默认显示c盘文件。如果像打开其他盘的文件:

方式1. 通过cmd

首先要进入base模式——输入:activate

输入d:转到对应盘,复制需要打开的文件路径,输入cd 路径(注意要输入cd)

【学习pytorch 01】Jupyter notebook+云GPU的使用_第3张图片

回车即可打开网页(注意cmd不能关否则服务器连接中断),显示如下: 

【学习pytorch 01】Jupyter notebook+云GPU的使用_第4张图片

 

 方式2. 通过Anaconda Prompt

【学习pytorch 01】Jupyter notebook+云GPU的使用_第5张图片

操作相同,只是不用activate进入base环境

方式3. 直接通过终端用jupyter notebook打开文件(最简单)

【学习pytorch 01】Jupyter notebook+云GPU的使用_第6张图片

【学习pytorch 01】Jupyter notebook+云GPU的使用_第7张图片

三、用云服务器跑代码

推荐openbayes(如果使用时间不长,可以白嫖几小时)

即刻连接人工智能 | OpenBayes 贝式计算

autoDL送的代金券比较多(长期用可以考虑)

创建了实例之后,会打开jupyter工作空间,然后上传本地代码就可以在上面跑了​​​​​​

 openbayes:【学习pytorch 01】Jupyter notebook+云GPU的使用_第8张图片

新手可以选一个免费的GPU(记得不用的时候按停止)

 

你可能感兴趣的:(pytorch,pytorch,jupyter,深度学习,服务器)