【问题标题】:Docker command for multiple tensorflow serving model?多张量流服务模型的 Docker 命令?
【发布时间】:2019-04-13 19:35:58
【问题描述】:

我正在尝试使用 tf_serving 的 docker 版本执行这个正常的 tf_serving 命令(可以正常工作)。我不确定为什么它不起作用..有什么建议吗?我是 Docker 新手!

普通 tf_serving 命令:

tensorflow_model_server \
--model_config_file=/opt/tf_serving/model_config.conf \
--port=6006

这是我的 model_config.conf 的样子:

model_config_list: {
  config: {
    name: "model_1",
    base_path: "/opt/tf_serving/model_1",
    model_platform: "tensorflow",
  },
  config: {
    name: "model_2",
    base_path: "/opt/tf_serving/model_2",
    model_platform: "tensorflow",
  },
}

我正在尝试但不起作用的命令的 Docker 版本:

docker run --runtime=nvidia \
-p 6006:6006 \
--mount type=bind,source=/opt/tf_serving/model_1,target=/models/model_1/ \
--mount type=bind,source=/opt/tf_serving/model_2,target=/models/model_2/ \
--mount type=bind,source=/opt/tf_serving/model_config.conf,target=/config/model_config.conf \
-t tensorflow/serving:latest-gpu --model_config_file=/config/model_config.conf

错误:

2019-04-13 19:41:00.838340:E tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:369] FileSystemStoragePathSource 遇到文件系统访问错误:找不到可服务模型_1 的基本路径 /opt/tf_serving/model_1

【问题讨论】:

    标签: docker tensorflow tensorflow-serving


    【解决方案1】:

    发现问题!您必须更改 model_config.conf 中的模型路径,如下所示,上面的 docker 命令将起作用并加载两个模型!

    model_config_list: {
      config: {
        name: "model_1",
        base_path: "/models/model_1",
        model_platform: "tensorflow",
      },
      config: {
        name: "model_2",
        base_path: "/models/model_2",
        model_platform: "tensorflow",
      },
    }
    

    编辑:更正了base_pathmodel_2 的拼写错误。

    【讨论】:

    • 您可以将上面的 docker 命令简化为:docker run --runtime=nvidia \ -p 6006:6006 --mount type=bind,source=/opt/tf_serving/,target=/models/ -t tensorflow/serving:latest-gpu --model_config_file=/models/model_config.conf。这将允许您添加更多模型而无需更改 cmd。您最初错误的原因是在 tf serve 服务器内部,它似乎只是/models/ 的目标挂载点,而不是主机的/opt/
    • 嗨,我猜model_config_list 中的第二个config.base_path 应该是“models/model_2”
    猜你喜欢
    • 2020-02-29
    • 1970-01-01
    • 2020-01-13
    • 2018-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-27
    • 2018-11-25
    相关资源
    最近更新 更多