# Cpp Predict Client

## Introduction

TensorFlow serving is the gRPC service for general TensorFlow models. We can implement the C++ gRPC client to predict.

If you are using `bazel`, refer to to [inception_client.cc](https://github.com/tensorflow/serving/pull/300)

## Usage

Add the binary in `tensorflow_serving/example/BUILD`.

```
cc_binary(
    name = "tensorflow_model_client",
    srcs = [
        "serving_client_cpp.cc",
    ],
    deps = [
        "//tensorflow_serving/apis:prediction_service_proto",
    ],
)
```

Compile the project.

```
bazel build //tensorflow_serving/example:tensorflow_model_client
```

Run the predict client.

```
bazel-bin/tensorflow_serving/example/tensorflow_model_client
```

# Cpp Predict Client

## Introduction

TensorFlow serving is the gRPC service for general TensorFlow models. We can implement the C++ gRPC client to predict.

Now you need to use `bazel` and just refer to to [inception_client.cc](https://github.com/tensorflow/serving/pull/300).

## Usage

Add the build rule in `tensorflow_serving/example/BUILD` and copy [sparse_predict_client.cc](./sparse_predict_client.cc) in example direcotry.

```
cc_binary(
    name = "sparse_predict_client",
    srcs = [
        "sparse_predict_client.cc",
    ],
    deps = [
        "//tensorflow_serving/apis:prediction_service_proto",
    ],
)
```

Compile the gRPC client.

```
bazel build //tensorflow_serving/example:sparse_predict_client
```

Run the predict client.

```
bazel-bin/tensorflow_serving/example/sparse_predict_client
```

Update the usage of sparse predict client in cpp
Update the usage of sparse predict client in cpp
