Docker 多个张量流服务模型的命令?

Docker command for multiple tensorflow serving model?

我正在尝试使用 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 encountered a file-system access error: Could not find base path /opt/tf_serving/model_1 for servable model_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 的拼写错误。