1. 开启Docker容器

  • Docker 配置方法见 https://www.yuque.com/jarvis73/pukm54/rwfl73

    1. docker run -t -p 8501:8501 -p 8500:8500 -v "D:/0WorkSpace/Project/model_dir/tag/export:/models/tag" -e MODEL_NAME=tag tensorflow/serving &
  • 8501 是 REST API

  • 8500 是 gRPC API

2. REST API

  • 模型状态API

    1. GET http://host:port/v1/models/${MODEL_NAME}[/versions/${MODEL_VERSION}]
    2. # Example: http://localhost:8501/v1/models/tag
    3. # Example: http://localhost:8501/v1/models/101_unetinter_v10/versions/0
  • 模型元数据API

    1. GET http://host:port/v1/models/${MODEL_NAME}[/versions/${MODEL_VERSION}]/metadata
    2. # Example: http://localhost:8501/v1/models/tag/metadata
    3. # Example: http://localhost:8501/v1/models/tag/versions/0/metadata