Some utilities for tensorflow serving
Project description
# serving-utils
[![Build Status](https://travis-ci.org/Yoctol/serving-utils.svg?branch=master)](https://travis-ci.org/Yoctol/serving-utils) [![PyPI version](https://badge.fury.io/py/serving-utils.svg)](https://badge.fury.io/py/serving-utils)
Some python utilities when using tensorflow-serving.
## Installation
From PYPI:
1. Manually install tensorflow CPU or GPU version.
2. `pip install serving-utils`
From Github repository:
1. `git clone git@github.com:Yoctol/serving-utils.git`
2. `make install`
## Usage
1. Client
```python
from serving_utils import Client
client = Client(addr="localhost:8500")
client.predict(...)
# or async
await client.async_predict(...)
```
2. Saver
```python
import tensorflow as tf
from serving_utils import Saver
saver = Saver(
session=tf.Session(graph=your_graph),
output_dir='/path/to/serving',
signature_def_map={
'predict': tf.saved_model.signature_def_utils.predict_signature_def(
inputs={'tensor_name': tf.Tensor...},
outputs={'tensor_name': tf.Tensor...},
)
},
)
saver.save(...)
```
## Test
Run the following commands:
```
make lint
make test
```
## Dev
```
make install
```
[![Build Status](https://travis-ci.org/Yoctol/serving-utils.svg?branch=master)](https://travis-ci.org/Yoctol/serving-utils) [![PyPI version](https://badge.fury.io/py/serving-utils.svg)](https://badge.fury.io/py/serving-utils)
Some python utilities when using tensorflow-serving.
## Installation
From PYPI:
1. Manually install tensorflow CPU or GPU version.
2. `pip install serving-utils`
From Github repository:
1. `git clone git@github.com:Yoctol/serving-utils.git`
2. `make install`
## Usage
1. Client
```python
from serving_utils import Client
client = Client(addr="localhost:8500")
client.predict(...)
# or async
await client.async_predict(...)
```
2. Saver
```python
import tensorflow as tf
from serving_utils import Saver
saver = Saver(
session=tf.Session(graph=your_graph),
output_dir='/path/to/serving',
signature_def_map={
'predict': tf.saved_model.signature_def_utils.predict_signature_def(
inputs={'tensor_name': tf.Tensor...},
outputs={'tensor_name': tf.Tensor...},
)
},
)
saver.save(...)
```
## Test
Run the following commands:
```
make lint
make test
```
## Dev
```
make install
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
serving-utils-0.4.4.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for serving_utils-0.4.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66843c660b6f51e42371020122d011edcbff21574e6871a4675a7ed9d85f6785 |
|
MD5 | f3e34dd2b03a96dca4abad4c0fb1c80e |
|
BLAKE2b-256 | a3e4691cebe3fb8a3de7927b6aa0a7cb85a3fdce6c895cd6dee8cbeec0b16629 |