使用GOOGLE COLAB訓練深度學習模型

使用

谷歌提供了免費的K80的GPU用於訓練深度學習的模型。並且最讚的是以notebook的形式提供,徹底能夠作到開箱即用。你能夠從Google driver處打開。或者這裏html

默認建立的是沒有GPU的,咱們須要修改,點擊「代碼執行程序」


而後就會有GPU使用了python

掛在Google雲盤

執行以下代碼app

!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}

而後按照提示進行驗證
而後掛載雲盤less

!mkdir -p drive
!google-drive-ocamlfuse drive

運行代碼!python3 drive/colab/xxx.py工具

下載數據文件學習

!wget https:xxxxxxx.csv -P drive/colab

關於此工具的faqgoogle

更多的介紹看這裏code



相關文章
相關標籤/搜索