

FastaiV3GCP(Google Cloud Platform) 配置笔记FastaiV3GCP(Google Cloud Platform) 配置笔记在Google Cloud Platform谷歌云上配置完成之后,咱们就拥有交互式编程笔记「JupyterNotebook」环境,配有GPU硬件图形加速器,以调动充......
在Google Cloud Platform谷歌云上配置完成之后,咱们就拥有交互式编程笔记「JupyterNotebook」环境,配有GPU硬件图形加速器,以调动充分的「算力」,来学习fast.ai的深度学习(炼丹)技术。
传快递门:fastai官方GCP服务配置教程https://course.fast.ai/start_gcp.html
07.09更新:国内朋友可以试试易学智能https://course.fast.ai/start_easyaiforum.html
步骤1:创建你的账户
前往官网https://cloud.google.com/,创建新账户。
价格与性能
·潜在的坑:尽管有300美元的初始额度,但我们需要开启账单(Billing)功能,绑定信用卡或借记卡,等候几个工作日之后激活它。
Potential roadblock:Even though GCP provides a$300 initial credit,you must enable billing to use it.You can put a credit card or a bank account but the latter will take several days for the activation.
·比如,结算的坑:你在GoogleClound里运行虚拟镜像的项目,需要连接至你的账单账号。导航到billing dashboard,点击「...」菜单,选择「更改账单账号」。
The project on which you are going to run the image needs to be linked with your billing account.For this navigate to the billing dashboard,click the‘…’menu and choose‘change billing account’.
步骤2:安装Google命令行工具
笔者使用的是macOS系统,进行了如下操作命令:
与报错不期而遇:连接Google的SDK服务失败,端口443,操作超时
查看官网文档
https://cloud.google.com/sdk/docs/quickstartmacos
在准备工作中的第二条,赫然写着
确保您的系统上安装了Python 2.7:
pythonV
系统反馈,我当前使用的是Python3.6.8版本使用pyenv模块,创建一个python2.7.x的虚拟环境?
警告:Python2.7要在2020年1月时被“废黜”。
激活所创建的虚拟环境
提示是否继续时,输入y
https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8085%2Fprompt=select_accountresponse_type=codeclient_id=32555940559.apps.googleusercontent.comscope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauthaccess_type=offline
这时,浏览器会自动打开授权页面,请授权你的谷歌云平台账号。
Project IDs must be 630 characters(lowercase ASCII,digits,or
hyphens)in length and start with a lowercase letter.fastai
WARNING:Project creation failed:HttpError accessinglt;https://cloudresourcemanager.googleapis.com/v1/projects alt=jsongt;:response:lt;{status:409,contentlength:119,xxssprotection:1;mode=block,xcontenttypeoptions:nosniff,transferencoding:chunked,vary:Origin,XOrigin,Referer,server:ESF,contentencoding:gzip,cachecontrol:private,date:Sun,27 Jan 2019 16:39:11 GMT,xframeoptions:SAMEORIGIN,altsvc:quic=:443;ma=2592000;v=44,43,39,contenttype:application/json;charset=UTF8}gt;,contentlt;{
error:{
code:409,
message:Requested entity already exists,
status:ALREADY_EXISTS
}
}
Please make sure to create the project [fastai] using
$gcloud projects create fastai
or change to another project using
$gcloud config set projectPROJECT ID
https://cloud.google.com/compute/docs/gcloudcompute
至此,谷歌云GCP的SDK配置完毕。
步骤3:创建一个实例(Instance)
输入各种配置指令,比如「IMAGE_FAMILY(镜像组合)」pytorchlatestgpu,「ZONE」uswest1b等等。最新操作步骤,请移步查阅https://course.fast.ai/start_gcp.html
Enabling service compute.googleapis.com on project 191131005934...
ERROR:(gcloud.compute.instances.create)FAILED_PRECONDITION:Operation does not satisfy the following requirements:billingenabled{Billing must be enabled for activation of servicein projectfastaiv3229916to proceed.,https://console.developers.google.com/project/fastaiv3229916/settings}
设置了结算账户之后,
image.png
image.png
步骤3:创建你的示例
再次输入CLI命令行代码,创建示例
功夫不负有心人,创建成功。
一大串的命令行英文,非常吓人。
查看GPU,型号是:Tesla P4
步骤4:接入fast.ai材料,更新工具包
回到控制台,
adi0229(adi0229)~
$pyenv activate googlecli
pyenvvirtualenv:prompt changing will be removed from future release.configure`export PYENV_VIRTUALENV_DISABLE_PROMPT=1to simulate the behavior.
(googlecli)adi0229(adi0229)~
步骤5:停止实例运行
参考资料
https://www.jianshu.com/p/7d720393fea3
https://course.fast.ai/update_gcp.html
https://course.fast.ai/start_gcp.html
特别声明:以上文章内容仅代表作者本人观点,不代表ESG跨境电商观点或立场。如有关于作品内容、版权或其它问题请于作品发表后的30日内与ESG跨境电商联系。
二维码加载中...
使用微信扫一扫登录
使用账号密码登录
平台顾问
微信扫一扫
马上联系在线顾问
小程序
ESG跨境小程序
手机入驻更便捷
返回顶部