如何配置Google Cloud Datalab以将GPU用于TensorFlow? [英] How do I configure Google Cloud Datalab to use GPUs for TensorFlow?

查看:435
本文介绍了如何配置Google Cloud Datalab以将GPU用于TensorFlow?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Cloud Datalab中导入tensorflow并运行模型,但是如何将其配置为使用GPU?



这里的文档只涉及机器,我不知道如何通过Datalab进行配置:
https://cloud.google.com/ml-engine/docs/how-tos/using-gpus



我试过这个:

p>

  datalab create --machine-type standard_gpu ml 

,当我选择us-east1区域时,出现错误:

 创建实例ml 
错误:(gcloud.compute.instances.create)某些请求未成功:
- 字段'resource.machineType'的值无效:'https://www.googleapis.com/计算/ V1 /项目/工程-160204 /区/ US-east1-d / machineTypes / standard_gpu。名称为'standard_gpu'的机器类型不存在于区域'us-east1-d'中。


解决方案

您链接到的页面( https://cloud.google.com/ml-engine/docs/how-tos / using-gpus )描述了如何在使用Google Cloud ML Engine API进行培训时使用GPU,并且您可以使用Datalab针对ML Engine API提交作业。一些样本包含在Datalab中(例如样本/ ML工具箱/图像分类/花卉/服务结束到End.ipynb)

如果您想训练一个Tensorflow模型在Datalab虚拟机上进行本地化,那么Datalab将不得不针对当前不支持的Datalab虚拟机上的GPU运行。


I can import tensorflow and run models inside of Cloud Datalab, but how do I configure it to use GPUs?

The documentation here only talks about machines, which I'm not sure how to configure through Datalab: https://cloud.google.com/ml-engine/docs/how-tos/using-gpus

I've tried this:

datalab create --machine-type standard_gpu ml

and when I select the us-east1 region, I get the error:

Creating the instance ml
ERROR: (gcloud.compute.instances.create) Some requests did not succeed:
- Invalid value for field 'resource.machineType': 'https://www.googleapis.com/compute/v1/projects/project-160204/zones/us-east1-d/machineTypes/standard_gpu'. Machine type with name 'standard_gpu' does not exist in zone 'us-east1-d'.

解决方案

The page you link to (https://cloud.google.com/ml-engine/docs/how-tos/using-gpus) does describe how to use GPUs when training using the Google Cloud ML Engine API, and you can submit a job against the ML Engine API using Datalab. Some samples of that are included in Datalab (e.g. samples/ML Toolbox/Image Classification/Flower/Service End to End.ipynb)

If you want to train a Tensorflow model locally on the Datalab VM, then Datalab would have to be running against a GPU on the Datalab VM, which is not currently supported.

这篇关于如何配置Google Cloud Datalab以将GPU用于TensorFlow?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆