
在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/quickstart-macos
在准备工作中的第二条,赫然写着
确保您的系统上安装了Python 2.7:
python-V
系统反馈,我当前使用的是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%2F&prompt=select_account&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+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.reauth&access_type=offline
这时,浏览器会自动打开授权页面,请授权你的谷歌云平台账号。
Project IDs must be 6-30 characters(lowercase ASCII,digits,or
hyphens)in length and start with a lowercase letter.fastai
WARNING:Project creation failed:HttpError accessing<https://cloudresourcemanager.googleapis.com/v1/projects?alt=json>:response:<{‘status’:’409′,’content-length’:’119′,’x-xss-protection’:’1;mode=block’,’x-content-type-options’:’nosniff’,’transfer-encoding’:’chunked’,’vary’:’Origin,X-Origin,Referer’,’server’:’ESF’,’-content-encoding’:’gzip’,’cache-control’:’private’,’date’:’Sun,27 Jan 2019 16:39:11 GMT’,’x-frame-options’:’SAMEORIGIN’,’alt-svc’:’quic=”:443″;ma=2592000;v=”44,43,39″‘,’content-type’:’application/json;charset=UTF-8′}>,content<{
“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 project
https://cloud.google.com/compute/docs/gcloud-compute
至此,谷歌云GCP的SDK配置完毕。
步骤3:创建一个实例(Instance)
输入各种配置指令,比如「IMAGE_FAMILY(镜像组合)」->”pytorch-latest-gpu”,「ZONE」->”us-west1-b”等等。最新操作步骤,请移步查阅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:billing-enabled{Billing must be enabled for activation of service”in project’fastai-v3-229916’to proceed.,https://console.developers.google.com/project/fastai-v3-229916/settings}
设置了结算账户之后,
image.png
image.png
步骤3:创建你的示例
再次输入CLI命令行代码,创建示例
功夫不负有心人,创建成功。
一大串的命令行英文,非常吓人。
查看GPU,型号是:Tesla P4
步骤4:接入fast.ai材料,更新工具包
回到控制台,
adi0229(adi0229)~
$pyenv activate google-cli
pyenv-virtualenv:prompt changing will be removed from future release.configure`export PYENV_VIRTUALENV_DISABLE_PROMPT=1’to simulate the behavior.
(google-cli)adi0229(adi0229)~
步骤5:停止实例运行
参考资料
https://www.jianshu.com/p/7d720393fea3
https://course.fast.ai/update_gcp.html
https://course.fast.ai/start_gcp.html
相关推荐: Wish卖家如何为误判“误导性变体”的产品发起申诉?“误导性变体”申诉的分步指南一览
Wish致力于持续有效地改善商户体验,并将根据Wish商户政策仔细审核每一件产品。但是,在极少情况下,产品可能会被误判为“误导性变体”。就此情况而言,您可以通过此申诉流程提供更多信息,使产品再次接受审核。 如果申诉获批,产品将可恢复上架,相关的误导性违规罚款也…
码刀科技(www.lekshop.cn)是国内知名企业级电商平台提供商,为企业级商家提供最佳的电商平台搭建(多种模式电商平台搭建:B2B/B2B2C/B2C/O2O/新零售/跨境等)、平台管理系统开发及互联网采购解决方案服务, 联系客服了解更多.