Use a Golang client

Brief introduction

To access the TensorFlow Serving service, Golang clients must implement a gRPC client.

Prepare the build environment

go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc

Complete example

Here is an example of exporting a model by using Golang to access the model:https://github.com/tobegit3hub/deep_recommend_system/tree/master/golang_predict_client

Implementation principles

The Golang client relies on the grpc-go project with the code address https://github.com/grpc/grpc-go and the official document address http://www.grpc.io/docs /tutorials/basic/go.html.

When implementing, we can refer to TensorFlow Serving's official example community-made tfclient project https://github.com/cmars/tfclient.