Deploying Keras Models via Google Cloud ML

1,635 views
Skip to first unread message

matthew...@metafused.com

unread,
Jan 31, 2017, 8:46:10 AM1/31/17
to Keras-users
Hi, I wonder if anyone here can help me. 

I am looking to use Google Cloud ML to host my Keras models so that I can call the API and make some predictions. I am running into some issues from the Keras side of things. 

So far I have been able to build a model using TensorFlow and deploy it on CloudML. In order for this to work I had to make some changes to my basic TF code. The changes are documented here: https://cloud.google.com/ml/docs/how-tos/preparing-models#code_changes

I have also been able to train a similar model using Keras which is obviously much quicker. I can even save the model in the same export and export.meta format as I would get with TF.

from keras import backend as K

saver
= tf.train.Saver()
session
= K.get_session()
saver
.save(session, 'export')

The part I am missing is how do I add the placeholders for input and output into the graph I build on Keras?

Any help would be much appreciated.

Thanks,
Matt

al...@goodman.io

unread,
Feb 20, 2017, 4:13:40 PM2/20/17
to Keras-users, matthew...@metafused.com
Francois wrote an example:


(see the “Exporting a model with TensorFlow-serving” section)

andre...@gmail.com

unread,
Mar 24, 2017, 1:12:26 PM3/24/17
to Keras-users, matthew...@metafused.com
Hi Matt,

I am working on a class project where I am considering to use Google Cloud ML using keras, but I don't have much background in ML. Do you know where can I find a sample file or program that I could use train, evaluate, and save a model to Google Cloud ML using keras? Or maybe if you have a test sample that you wouldn't mind sharing?

Thank you, 
Andres


On Tuesday, January 31, 2017 at 8:46:10 AM UTC-5, matthew...@metafused.com wrote:

liuf...@gmail.com

unread,
Apr 6, 2017, 6:49:17 AM4/6/17
to Keras-users, matthew...@metafused.com, andre...@gmail.com
Hey Andres

These days I have been trying to run some simple models via Google Cloud ML and I also tried it with Keras. I am working on a post (url below) and will later update the info on how to get Keras work. Maybe it can help you.


Best regards
Fuyang

pra...@getwellio.com

unread,
Apr 14, 2017, 1:31:24 PM4/14/17
to Keras-users, matthew...@metafused.com, andre...@gmail.com, liuf...@gmail.com
Hey liu , 
I found your tutorial very helpful , i was able to run the complete code , printing the accuracy but the job failed with the following error:

Module raised an exception for failing to call a subprocess Command '['python', '-m', u'trainer.example4'

Your insight on the above would be helpful.

Thanking You,
pranav
Reply all
Reply to author
Forward
0 new messages