Fastai-V3-GCP(Google Cloud Platform) 配置筆記

來(lái)源:簡(jiǎn)書(shū)
作者:adi0229
時(shí)間:2020-06-17
2837
在Google Cloud Platform谷歌云上配置完成之后,咱們就擁有交互式編程筆記「JupyterNotebook」環(huán)境,配有GPU硬件圖形加速器,以調(diào)動(dòng)充分的「算力」,來(lái)學(xué)習(xí)fast.ai的深度學(xué)習(xí)(煉丹)技術(shù)。

1592376863(1).png

在Google Cloud Platform谷歌云上配置完成之后,咱們就擁有交互式編程筆記「JupyterNotebook」環(huán)境,配有GPU硬件圖形加速器,以調(diào)動(dòng)充分的「算力」,來(lái)學(xué)習(xí)fast.ai的深度學(xué)習(xí)(煉丹)技術(shù)。

傳送門(mén):fastai官方GCP服務(wù)配置教程https://course.fast.ai/start_gcp.html

07.09更新:國(guó)內(nèi)朋友可以試試->易學(xué)智能https://course.fast.ai/start_easyaiforum.html

步驟1:創(chuàng)建你的賬戶(hù)

前往官網(wǎng)https://cloud.google.com/,創(chuàng)建新賬戶(hù)。

價(jià)格與性能

·潛在的坑:盡管有300美元的初始額度,但我們需要開(kāi)啟賬單(Billing)功能,綁定信用卡或借記卡,等候幾個(gè)工作日之后激活它。

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.

·比如,結(jié)算的坑:你在GoogleClound里運(yùn)行虛擬鏡像的項(xiàng)目,需要連接至你的賬單賬號(hào)。導(dǎo)航到billing dashboard,點(diǎn)擊「...」菜單,選擇「更改賬單賬號(hào)」。

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系統(tǒng),進(jìn)行了如下操作命令:

1592377028(1).png

與報(bào)錯(cuò)不期而遇:連接Google的SDK服務(wù)失敗,端口443,操作超時(shí)

1592377170(1).png

查看官網(wǎng)文檔

https://cloud.google.com/sdk/docs/quickstart-macos

在準(zhǔn)備工作中的第二條,赫然寫(xiě)著

確保您的系統(tǒng)上安裝了Python 2.7:

python-V

1592377196(1).png

1592377245(1).png

系統(tǒng)反饋,我當(dāng)前使用的是Python3.6.8版本使用pyenv模塊,創(chuàng)建一個(gè)python2.7.x的虛擬環(huán)境?

警告:Python2.7要在2020年1月時(shí)被“廢黜”。

1592377269(1).png

1592377294(1).png

1592377321(1).png

激活所創(chuàng)建的虛擬環(huán)境

1592377382(1).png

1592377413(1).png

提示是否繼續(xù)時(shí),輸入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

這時(shí),瀏覽器會(huì)自動(dòng)打開(kāi)授權(quán)頁(yè)面,請(qǐng)授權(quán)你的谷歌云平臺(tái)賬號(hào)。

452087-a2788523a39908a5.jpg

452087-b811896795b62ac2.jpg

452087-574aafb20baec52c.jpg

1592377570(1).png

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<PROJECT ID>

1592377607(1).png

https://cloud.google.com/compute/docs/gcloud-compute

至此,谷歌云GCP的SDK配置完畢。

步驟3:創(chuàng)建一個(gè)實(shí)例(Instance)

輸入各種配置指令,比如「IMAGE_FAMILY(鏡像組合)」->"pytorch-latest-gpu",「ZONE」->"us-west1-b"等等。最新操作步驟,請(qǐng)移步查閱https://course.fast.ai/start_gcp.html

1592377655(1).png

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}

設(shè)置了結(jié)算賬戶(hù)之后,

1592377701(1).png

452087-b076b92ce04eb721.jpg

image.png

452087-79580e4227586702.jpg

452087-f45eabd43e66bd33.jpg

452087-977d3bb5a96ef199.jpg

image.png

步驟3:創(chuàng)建你的示例

452087-cc8a381e7cf98d6c.jpg

再次輸入CLI命令行代碼,創(chuàng)建示例

1592377791(1).png

功夫不負(fù)有心人,創(chuàng)建成功。

1592377855(1).png

452087-977d3bb5a96ef199.jpg

1592377891(1).png

一大串的命令行英文,非常嚇人。

1592377929(1).png

1592377950(1).png

查看GPU,型號(hào)是:Tesla P4

1592377980(1).png

步驟4:接入fast.ai材料,更新工具包

1592378005(1).png

1592378246(1).png

1592378269(1).png

1592378305(1).png

回到控制臺(tái),

452087-18df5a0a3866732d.jpg


452087-03b7032f6edf7ca5.jpg


452087-8cb1d31ca44a15f6.jpg

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:停止實(shí)例運(yùn)行

452087-4e2007a1f888fa4d.jpg

參考資料

https://www.jianshu.com/p/7d720393fea3

https://course.fast.ai/update_gcp.html

https://course.fast.ai/start_gcp.html

原文鏈接:點(diǎn)擊前往 >
版權(quán)說(shuō)明:本文內(nèi)容來(lái)自于簡(jiǎn)書(shū),本站不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。文章內(nèi)容系作者個(gè)人觀點(diǎn),不代表快出海對(duì)觀點(diǎn)贊同或支持。如有侵權(quán),請(qǐng)聯(lián)系管理員(zzx@kchuhai.com)刪除!
相關(guān)文章
進(jìn)軍高增長(zhǎng)市場(chǎng),公司繼續(xù)保持兩位數(shù)增長(zhǎng),谷歌為何應(yīng)該逢低買(mǎi)入?
進(jìn)軍高增長(zhǎng)市場(chǎng),公司繼續(xù)保持兩位數(shù)增長(zhǎng),谷歌為何應(yīng)該逢低買(mǎi)入?
出色的財(cái)務(wù)表現(xiàn)是其堅(jiān)實(shí)基本面的一大亮點(diǎn)。
Google Cloud
投融資
2025-01-22
新版GKE可管理最多6.5萬(wàn)集群節(jié)點(diǎn),超越AWS、Azure 10倍
新版GKE可管理最多6.5萬(wàn)集群節(jié)點(diǎn),超越AWS、Azure 10倍
Google Cloud公布最新Google Kubernetes Engine版本,號(hào)稱(chēng)可支持最高達(dá)65,000個(gè)節(jié)點(diǎn)的服務(wù)器集群,以執(zhí)行超大型AI模型。
Google Cloud
云服務(wù)
云計(jì)算
2024-11-15
Google Cloud細(xì)說(shuō)AI變現(xiàn)途徑:用戶(hù)一年暴增10倍
Google Cloud細(xì)說(shuō)AI變現(xiàn)途徑:用戶(hù)一年暴增10倍
Google云計(jì)算平臺(tái)(Google Cloud)首席執(zhí)行官Thomas Kurian在高盛舉行的會(huì)議上,說(shuō)明了該公司究竟是通過(guò)哪些途徑將AI變現(xiàn)。
Google Cloud
谷歌云
云計(jì)算
2024-09-13
云計(jì)算平臺(tái)GCP的服務(wù)存在權(quán)限提升漏洞,未經(jīng)授權(quán)的攻擊者可借此訪(fǎng)問(wèn)敏感數(shù)據(jù)
云計(jì)算平臺(tái)GCP的服務(wù)存在權(quán)限提升漏洞,未經(jīng)授權(quán)的攻擊者可借此訪(fǎng)問(wèn)敏感數(shù)據(jù)
7月24日安全企業(yè)Tenable披露影響Google Cloud Platform(GCP)的權(quán)限提升漏洞ConfusedFunction,這項(xiàng)弱點(diǎn)發(fā)生在名為Cloud Functions的無(wú)服務(wù)器運(yùn)算服務(wù),以及稱(chēng)作Cloud Build的CICD渠道服務(wù)。
Google Cloud
谷歌云
云計(jì)算
2024-07-27
優(yōu)質(zhì)服務(wù)商推薦
更多
個(gè)人VIP
小程序
快出海小程序
公眾號(hào)
快出海公眾號(hào)
商務(wù)合作
商務(wù)合作
投稿采訪(fǎng)
投稿采訪(fǎng)
出海管家
出海管家