TensorFlow on GCP

30
GCP TensorFlow Google Cloud ML Engine & Dataflow H.Yoshikawa (@hayatoy) TFUG #5 24 May 2017

Transcript of TensorFlow on GCP

Page 1: TensorFlow on GCP

GCP TensorFlow

Google Cloud ML Engine & Dataflow

H.Yoshikawa (@hayatoy)TFUG #524 May 2017

Page 2: TensorFlow on GCP

@hayatoy

APAC

TFUGGCPUGGDG

Presenter

Page 3: TensorFlow on GCP
Page 4: TensorFlow on GCP
Page 5: TensorFlow on GCP

Google Cloud ML Engine

Jupyter Notebook [DEMO]

Online Prediction [DEMO]

Google Cloud Dataflow

Page 6: TensorFlow on GCP

Cloud ML Engine

Page 7: TensorFlow on GCP

Cloud ML Engine

TensorFlow

Online Prediction

←ktkr!

Page 8: TensorFlow on GCP

Cloud ML Engine

Page 9: TensorFlow on GCP

Cloud ML Engine

Page 10: TensorFlow on GCP
Page 11: TensorFlow on GCP

Package

 gcloud 

REST APIPackage

Jupyter Notebook ←New!

Page 12: TensorFlow on GCP

 gcloud GCP

gcloud ml-engine jobs submit

COMMAND [GLOBAL-FLAG …]

Page 13: TensorFlow on GCP

REST API

Python Client Library

from oauth2client.client import GoogleCredentialsfrom googleapiclient import discovery

credentials = GoogleCredentials.get_application_default()ml = discovery.build('ml', 'v1', credentials=credentials)

job_req = ml.projects().jobs().create( parent=project_id, body=param)job_req.execute()

Page 14: TensorFlow on GCP

Jupyter Notebook

Notebook Cloud ML Engine

https://github.com/hayatoy/cloudml‑magic

Page 15: TensorFlow on GCP
Page 16: TensorFlow on GCP

Online Prediction ‑ Demo

Page 17: TensorFlow on GCP

pix2pix GCPUG

bit.ly/realgcpug

Page 18: TensorFlow on GCP

pix2pix

Page 19: TensorFlow on GCP

GCPUG

Original Edge 20 epochs 200 epochs

Page 20: TensorFlow on GCP

Online Prediction

SavedModel v1

serving_input_fn

Beta

Page 21: TensorFlow on GCP

Cloud Dataflow

Page 22: TensorFlow on GCP

Cloud Dataflow

ETL

tf.Transform

Dynamic Work Rebalancing

GCE

MapReduce

Page 23: TensorFlow on GCP

Dataflow

Page 24: TensorFlow on GCP

Dataflow

Page 25: TensorFlow on GCP

BigQuery, GCS

query = "SELECT * FROM [project:dataset.table]"

p = beam.Pipeline(options=options)

(p | 'query image list' >> beam.Read(beam.io.BigQuerySource(query=query))

| 'download image' >> beam.FlatMap(download_image)

| 'crop and resize image' >> beam.Map(crop_image)

| 'make edge image' >> beam.Map(make_edge_image)

Page 26: TensorFlow on GCP

1000

DWR

Cap opt.max_num_workers = 10 

Page 27: TensorFlow on GCP

Dataflow

Page 28: TensorFlow on GCP
Page 29: TensorFlow on GCP

GCP

Page 30: TensorFlow on GCP

Thank you!

Cloud ML Engine

https://cloud.google.com/ml‑engine/

Cloud Dataflow

https://cloud.google.com/dataflow/

Cloud ML Engine ‑ Jupyter Notebook Extension

https://github.com/hayatoy/cloudml‑magic