1 TensorFlow Serving
1.1 工程结构
1.1.1 项目结构
├── modules # 此目录仅做模型参考,无需放到git的代码中
│ └── demo
│ └── 00000123
│ ├── assets
│ │ └── foo.txt
│ ├── saved_model.pb
│ └── variables
│ ├── variables.data-00000-of-00001
│ └── variables.index
├── README.md
├── .gitignore
└── modules.config
1.1.2 系统目录结构
模型发布对应目录
/modules #容器中挂载的目录
1.1.3 模型目录
├── modules
│ └── demo
│ └── 00000123
│ ├── assets
│ │ └── foo.txt
│ ├── saved_model.pb
│ └── variables
│ ├── variables.data-00000-of-00001
│ └── variables.index
1.2 模型配置上线
model_config_list:{
config:{
# 健康检查,所有项目必备
name:"demo",
base_path:"/modules/demo",
model_platform:"tensorflow",
model_version_policy:{
all:{}
}
}
}
1.3 模型上传
将模型文件上传至挂载盘中
1.4 模型上线检查
接口检查验证
curl http://localhost:8501/v1/models/demo/versions/123/metadata
用用接口
curl -d ‘{“instances”: [1.0, 2.0, 5.0]}’ -X POST http://localhost:8501/v1/models/demo:predict