Retrained inception_v3 model deployed in Cloud ML Engine always outputs the same predictions

后端 未结 3 2142

I followed the codelab TensorFlow For Poets for transfer learning using inception_v3. It generates retrained_graph.pb and retrained_labels.txt files, which can used to make

3条回答
  •  醉酒成梦
    2021-01-01 03:42

    For anyone working on deploying TensorFlow image-based models on Google Cloud ML, in particular trying to get the base64 encoding working for images (as discussed in this question), I'd recommend also having a look at the following repo that I put together. I spent a lot of time working through the deployment process and was only able to find partial information across the web and on stack overflow. This repo has a full working version of deploying a TensorFlow tf.keras model onto google cloud ML and I think it will be of help to people who are facing the same challenges I faced. Here's the github link:

    https://github.com/mhwilder/tf-keras-gcloud-deployment.

    The repo covers the following topics:

    1. Training a fully convolutional tf.keras model locally (mostly just to have a model for testing the next parts)
    2. Example code for exporting models that work with the Cloud ML Engine
    3. Three model versions that accept different JSON input types (1. An image converted to a simple list string, 2. An image converted to a base64 encoded string, and 3. A URL that points to an image in a Google Storage bucket)
    4. Instructions and references for general Google Cloud Platform setup
    5. Code for preparing the input JSON files for the 3 different input types
    6. Google Cloud ML model and version creation instructions from the console
    7. Examples using the Google Cloud SDK to call predict on the models

提交回复
热议问题