ageron / handson-ml2

A series of Jupyter notebooks that walk you through the fundamentals of Machine Learning and Deep Learning in Python using Scikit-Learn, Keras and TensorFlow 2.
Apache License 2.0
28.01k stars 12.81k forks source link

Chapter 19 : Training and Deploying TF Models at scale #205

Open Fred-Oru opened 4 years ago

Fred-Oru commented 4 years ago

Hello, I successfully reproduced the process described in "Using the Prediction Service" p682-683 of the book with the toy model "my_mnist_model' (turns the trained model into a serverless cloud model). However, when it failed when I tried with a more evolved model (a Mask-RCNN running on 1600*1900 images), because the json format is not adapted to images ("Rest Json call not working : Request payload size exceeds the limit: 1572864 bytes.")

I'm trying to switch to gRPC, but it seems that the Google API doesn't provide an easy way to do this. If I'm wrong, could you please provide a code for the "predict(X)" function on page 684(* or in section Deploy the model to Google Cloud AI Platform of the Chapter 19 Notebook in github) that uses gRPC instead of Json to transfer the input data ?

If you have any other way to feed large images to a serverless model, I'm all ears. Thanks for your help .

Fred-Oru commented 4 years ago

@ageron could you please advise ? Thanks for your help.