I've followed the TensorFlow for Poets tutorial and replaced the stock flower_photos with a few classes of my own. Now I've got my labels.txt
file and my graph.pb
saved on my local machine.
Is there a way for me to deploy this pre-trained model to Google Cloud Platform? I've been reading the docs and all I can find are instructions on how to create, train, and deploy models from within their ML Engine. But I don't want to spend money training my model on Google's servers when I only need them to host my model so I can call it for predictions.
Anyone else run into the same problem?
Partial answer only, unfortunately, but I have been able to accomplish this...but with some ongoing issues that I have not yet resolved. I ported over the trained pb and txt files to my server, installed Tensorflow, and am calling the trained model via HTTP request. It works perfectly...on the first run. Then fails every other time.
tensorflow deployment on openshift, errors with gunicorn and mod_wsgi
Surprised there are not more people out there trying to go after this general issue.
Deploying a locally trained model is a supported use case; the instructions are essentially the same regardless of where you trained it:
Unfortunately, TensorFlow for Poets does not show how to export a SavedModel (I've filed a feature request to address that). In the meantime, you can write a "converter" script like the following (you could alternatively do this at the end of training instead of saving out
graph.pb
and reading it back in):(Untested code based on this codelab and this SO post).
If you want the output to use string labels instead of integer indices, make the following change: