TensorFlow Serving 的部署方式有很多:
在 Quick Start 中以 使用Docker安装Tensorflow Serving 为例。
服务部署及调用时需要用到的变量有:
docker pull tensorflow/serving
将包含saved_model.pb
, assets
, variables
的模型目录以数字版本号命名,服务会自动调用目录内版本号最高的模型文件,模型目录示例如下:
e.g.
# 此时模型目录 $MODEL_PATH = "/Users/eric/work/wheel/tmp/tensorflow_serving/fm_models"
➜ tree /Users/eric/work/wheel/tmp/tensorflow_serving/fm_models
/Users/eric/work/wheel/tmp/tensorflow_serving/fm_models
├── 001
│ ├── assets
│ ├── saved_model.pb
│ └── variables
│ ├── variables.data-00000-of-00001
│ └── variables.index
└── 002
├── assets
├── saved_model.pb
└── variables
├── variables.data-00000-of-00001
└── variables.index
6 directories, 6 files
运行方式模板为: