Deploy Retrained inception model on Google cloud machine learning

可紊 提交于 2019-12-01 21:42:30

In your example, the input tensor is 'DecodeJpeg/contents:0', so you would have something like:

inputs = {'image': 'DecodeJpeg/contents:0')
outputs = {'prediction': 'final_result:0')

(Be sure to follow all of the instructions for preparing a model).

The model directory you intend to export should have files such as:

gs://my_bucket/path/to/model/export.meta
gs://my_bucket/path/to/model/checkpoint*

When you deploy your model, be sure to set gs://my_bucket/path/to/model as the deployment_uri.

To send an image to the service, as you suggest, you will need to base64 encode the image bytes. The body of your request should look like the following (note the 'tag', 'b64', indicating the data is base-64 encoded):

{'instances': [{'b64': base64.b64encode(image)}]}

We've now released a tutorial on how to retrain the Inception model, including instructions for how to deploy the model on the CloudML service.

https://cloud.google.com/blog/big-data/2016/12/how-to-train-and-classify-images-using-google-cloud-machine-learning-and-cloud-dataflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!