- 1.fan qiang
Browsing websites outside of China
这个具体怎么样操作就不介绍, 懂得都懂!
How to operate this specific operation will not be introduced.
if you know it, you will understand it!
- 2.申请谷歌账号
Apply for a Google Account
官方链接注意:最好是注册一个谷歌邮箱,因为外国发163或者qq邮箱容易被识别为垃圾邮箱!
PS: It is best to register a Google mailbox, because foreign 163 or qq mailboxes are easily identified as spam mailboxes!
注册好之后,是这样!
After registering, that's it!
- 3.在
Google Drive
上创建Colaboratory
Create Colaboratory on Google Drive
首先,点击云端硬盘进入
First, click on Google Drive to enter
再,新建文件夹coder
Then, create a new folder [coder]
例如
for example
最后创建Colaboratory
Finally, create Colaboratory
点击Google Colaboratory
进行创建run.ipynb
Click `Google Colaboratory` to create `run.ipynb`
例如
for example
- 4.设置免费的
GPU
Set up free GPU
首先点击Edit->Notebook settings
First click on `Edit->Notebook settings`
再,在Hardware acclerator
中选择GPU
,点击save
。
Then, select GPU in Hardware acclerator and click save.
- 5.授权与安装库
Licensing and Installing Libraries
需要输入代码code required
:
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}
点击(click)
运行代码后的状态为下图:
The state after running the code is as follows:
点击它给出的链接如下图:
Click on the link it gives as shown below:
点击账号登录:
Click to log in
会得到一大串验证码,将其复制,并且输入进刚才的空白格子中。
You will get a large string of verification codes, copy them, and enter them into the blank box just now.
注意,一定要点击enter!
PS: be sure to click enter!
之后还有几次重复操作,便会提示成功!(使用的是别人的图,因为此时我已经有GPU了)
After several repetitions, it will prompt success! (I used someone else's picture, because I already have a GPU at this time)
测试新申请的GPU
:
Test the newly applied GPU
:
success!