Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

While working on Udacity Deep Learning assignments, I encountered memory problem. I need to switch to a cloud platform. I worked with AWS EC2 before but now I would like to try Google Cloud Platform (GCP). I will need at least 8GB memory. I know how to use docker locally but never tried it on the cloud.

  1. Is there any ready-made solution for running Tensorflow on GCP?
  2. If not, which service (Compute Engine or Container Engine) would make it easier to get started?
  3. Any other tip is also appreciated!
like image 497
Thoran Avatar asked Apr 28 '16 13:04

Thoran


People also ask

Which machine learning service can run TensorFlow at scale in Google Cloud?

Because Google created and open-sourced TensorFlow, Google Cloud is uniquely positioned to offer support and insights directly from the TensorFlow team itself. Combined with our deep expertise in AI and machine learning, this makes TensorFlow Enterprise the best way to run TensorFlow.

Is TensorFlow a part of GCP?

TensorFlow Enterprise is a TensorFlow distribution optimized for GCP.

Why TensorFlow on Google Cloud?

The best of TensorFlow meets the best of Google Cloud. Ensure your TensorFlow project’s success with enterprise-ready services and support. Accelerate and scale your ML workflows on the cloud with compatibility-tested and optimized TensorFlow. Develop and deploy TensorFlow across managed services like Vertex AI and Google Kubernetes Engine .

What is Google Cloud Platform Services?

Google Cloud Platform Services Summary. Google Cloud Storage: Google Cloud Storage is a RESTful service for storing and accessing your data on Google's infrastructure. The service combines the performance and scalability of Google's cloud with advanced security and sharing capabilities.

What can you do with prioritized TensorFlow?

Prioritized patches and bug fixes into the mainline TensorFlow code repository. Automatic provisioning, optimizing, and scaling of resources across CPUs, GPUs, and Cloud TPUs. Learn how to add human-like capabilities of sight, language, and conversation to your business applications with unmatched scale and speed.

What is Google Cloud Storage?

Cloud Storage: Cloud Storage is a RESTful service for storing and accessing your data on Google's infrastructure. The service combines the performance and scalability of Google's cloud with advanced security and sharing capabilities.


Video Answer


4 Answers

Summing up the answers:

  • AI Platform Notebooks - One click Jupyter Lab environment
  • Deep Learning VMs images - Raw VMs with ML libraries pre-installed
  • Deep Learning Container Images - Containerized versions of the DLVM images
  • Cloud ML
  • Manual installation on Compute Engine. See instructions below.

Instructions to manually run TensorFlow on Compute Engine:

  1. Create a project
  2. Open the Cloud Shell (a button at the top)
  3. List machine types: gcloud compute machine-types list. You can change the machine type I used in the next command.
  4. Create an instance:
gcloud compute instances create tf \
  --image container-vm \
  --zone europe-west1-c \
  --machine-type n1-standard-2
  1. Run sudo docker run -d -p 8888:8888 --name tf b.gcr.io/tensorflow-udacity/assignments:0.5.0 (change the image name to the desired one)
  2. Find your instance in the dashboard and edit default network.
  3. Add a firewall rule to allow your IP as well as protocol and port tcp:8888.
  4. Find the External IP of the instance from the dashboard. Open IP:8888 on your browser. Done!
  5. When you are finished, delete the created cluster to avoid charges.

This is how I did it and it worked. I am sure there is an easier way to do it.

More Resources

You might be interested to learn more about:

  • Google Cloud Shell
  • Container-Optimized Google Compute Engine Images
  • Google Cloud SDK for a more responsive shell and more.

Good to know

  • "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"
  • To list all available image versions: gcloud compute images list --project google-containers

Thanks to @user728291, @MattW, @CJCullen, and @zain-rizvi

like image 148
Thoran Avatar answered Oct 17 '22 00:10

Thoran


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.

like image 28
Jing Jing Long Avatar answered Oct 17 '22 00:10

Jing Jing Long


Google has a Cloud ML platform in a limited Alpha.

Here is a blog post and a tutorial about running TensorFlow on Kubernetes/Google Container Engine.

If those aren't what you want, the TensorFlow tutorials should all be able to run on either AWS EC2 or Google Compute Engine.

like image 31
CJ Cullen Avatar answered Oct 17 '22 02:10

CJ Cullen


You now can also use pre-configured DeepLearning images. They have everything that is required for the TensorFlow.

like image 2
Viacheslav V Kovalevskyi Avatar answered Oct 17 '22 01:10

Viacheslav V Kovalevskyi