Files
fission-src/examples/tensorflow-serving/README.md
T
Ta-Ching ChenandGitHub 8f6887280c Allow to set API type for tensorflow serving environment (#1371)
Tensorflow Serving supports three kinds of API: predict, classify, regress. In order to fully support possible API types, this PR adds code to split the entry point with separator ":" to get model name and the API type separately. And append the API type to proxy URL when receiving the requests.

$ fission fn create --name t1 --pkg <pkg name> \
    --env tensorflow --entrypoint "half_plus_two:regress"
2019-11-02 23:51:31 +08:00

782 B

Tensorflow Serving Environment Example

Create Environment

$ fission env create --name tensorflow --image fission/tensorflow-serving-env --version 2

Create Package

$ zip -r half_plus_two.zip ./half_plus_two
$ fission pkg create --env tensorflow --deploy half_plus_two.zip

Create Function

Here, the --entrypoint represents the name of the top directory contains the trained model and what kind of API the model supports. Currently, three API are supported: predict, classify, regress. predict API will be used if no API kind was given.

$ fission fn create --name t1 --pkg <pkg name> --env tensorflow --entrypoint "half_plus_two:predict"
$ fission fn test --name t1 --body '{"instances": [1.0, 2.0, 0.0]}' --method POST