哪个 Google Cloud Platform 服务对于 运行 Tensorflow 来说最简单?

Which Google Cloud Platform service is the easiest for running Tensorflow?

在处理 Udacity 深度学习作业时,我遇到了内存问题。我需要切换到云平台。我之前使用过 AWS EC2,但现在我想尝试 Google Cloud Platform (GCP)。我至少需要 8GB 内存。我知道如何在本地使用 docker 但从未在云端尝试过。

  1. GCP 上的 运行 Tensorflow 是否有现成的解决方案?
  2. 如果不是,哪种服务(Compute Engine 或 Container Engine)会更容易上手?
  3. 任何其他提示也非常感谢!

Google 在有限的 Alpha 中有 Cloud ML platform

这里是 blog post and a tutorial 关于 运行 在 Kubernetes/Google 容器引擎上使用 TensorFlow。

如果这些不是您想要的,TensorFlow tutorials 应该都能够 运行 在 AWS EC2 或 Google Compute Engine 上。

总结答案:

Compute Engine 上手动 运行TensorFlow 的说明:

  1. Create a project
  2. 打开 Cloud Shell(顶部的按钮)
  3. 列出机器类型:gcloud compute machine-types list。您可以更改我在下一个命令中使用的机器类型。
  4. 创建实例:
gcloud compute instances create tf \
  --image container-vm \
  --zone europe-west1-c \
  --machine-type n1-standard-2
  1. 运行 sudo docker run -d -p 8888:8888 --name tf b.gcr.io/tensorflow-udacity/assignments:0.5.0(将图片名称改成自己想要的)
  2. dashboard 中找到您的实例并编辑 default 网络。
  3. 添加防火墙规则以允许您的 IP 以及协议和端口 tcp:8888
  4. 从仪表板中找到实例的外部 IP。在浏览器中打开 IP:8888。完成!
  5. 完成后,删除创建的集群以避免收费。

我就是这样做的,而且效果很好。我相信有更简单的方法。

更多资源

您可能有兴趣了解更多信息:

很高兴知道

  • "The contents of your Cloud Shell home directory persist across projects between all Cloud Shell sessions, even after the virtual machine terminates and is restarted"
  • 列出所有可用的图像版本:gcloud compute images list --project google-containers

感谢@user728291、@MattW、@CJCullen 和@zain-rizvi

Google Cloud Machine Learning is open to the world in Beta form today. It provides TensorFlow as a Service so you don't have to manage machines and other raw resources. As part of the Beta release, Datalab has been updated to provide commands and utilities for machine learning. Check it out at: http://cloud.google.com/ml.

我不确定您是否需要留在 Google 云平台上。如果您能够使用其他产品,您可能会节省很多时间和一些钱。

如果您使用的是 TensorFLow,我会推荐一个名为 TensorPort 的平台。它专用于 TesnorFlow,是我所知道的简单平台。代码和数据使用 git 加载,它们提供了一个 python 模块,用于自动切换远程和本地计算机之间的路径。如果需要,他们还提供一些用于设置分布式计算的样板代码。希望这可以帮助。

您现在还可以使用预配置的深度学习 images。他们拥有 TensorFlow 所需的一切。

这是一个老问题,但现在有了更简单的新选项:

如果您想 运行 TensorFlow 与 Jupyter Lab

GCP AI Platform Notebooks,它使您可以单击访问预装了 Tensorflow 的 Jupyter Lab Notebook(如果您愿意,也可以使用 Pytorch、R 或其他一些库)。

如果您只想使用原始 VM

如果您不关心 Jupyer Lab,而只想使用预安装了 Tensorflow 的原始 VM,则可以使用 GCP Deep Learning VM Image 创建一个 VM。这些 DLVM 图像为您提供了一个预装了 Tensorflow 的 VM,并且如果您愿意,它们都可以设置为使用 GPU。 (AI Platform Notebooks 在底层使用这些 DLVM 图像)

如果你想运行它在你的笔记本电脑和云端

最后,如果您希望能够 运行 在您的个人笔记本电脑和云中使用 tensorflow,并且愿意使用 Docker,您可以使用 GCP 的 Deep Learning Container Images。它包含与 DLVM 映像完全相同的设置,但打包为容器,因此您可以在任何您喜欢的地方启动它们。

额外好处:如果您运行在笔记本电脑上安装此容器映像,它是 100% 免费的 :D