您的位置:首页 > 编程语言 > Go语言

使用GOOGLE COLAB训练深度学习模型

2018-01-27 17:56 531 查看
使用

谷歌提供了免费的K80的GPU用于训练深度学习的模型。而且最赞的是以notebook的形式提供,完全可以做到开箱即用。你可以从Google driver处打开。或者这里

默认创建的是没有GPU的,我们需要修改,点击“代码执行程序”





然后就会有GPU使用了

挂在Google云盘

执行如下代码

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


然后按照提示进行验证

然后挂载云盘

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


运行代码
!python3 drive/colab/xxx.py


下载数据文件

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


关于此工具的faq

更多的介绍看这里

来自为知笔记(Wiz)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: