【问题标题】:Tensorflow Serving of model with 3 versions present on disk but only latest is availableTensorflow Serving 模型在磁盘上有 3 个版本,但只有最新版本可用
【发布时间】:2018-06-22 18:10:58
【问题描述】:

我正在使用 --model_config_file 选项运行 tensorflow_model_server(使用 apt-get 安装的 1.8.0 版)。

我的配置文件是这样的:

model_config_list: {
  config: {
    name: "MyModelName",
    base_path: "<path to model>/MyModelName"
    model_platform: "tensorflow"
  }
}

在 MyModelName 目录中有模型的 3 个版本(目录 1、2 和 3)。

当我启动模型服务器时,我可以看到版本 3 可用,我可以通过服务客户端访问它,方法是不指定版本(因此假定为最新版本)或专门要求版本 3。

如果我尝试特别要求模型的版本 2,则请求将失败并显示错误消息“未找到请求的可服务:特定(MyModelName,2)”。

是否可以通过 tensorflow_model_server 命令行选项或我的模型配置文件的内容使磁盘上存在的所有模型版本可供使用?

【问题讨论】:

    标签: tensorflow-serving


    【解决方案1】:

    我试图解决同样的问题。如果您看到ModelConfig 定义,则有一个名为model_version_policy 的字段FileSystemStoragePathSourceConfig.ServableVersionPolicy。因此,理想情况下,如果您在配置中设置此字段,如下所示:

    model_config_list: {
      config: {
        name: "MyModelName",
        base_path: "<path to model>/MyModelName"
        model_platform: "tensorflow",
        model_version_policy: {all: {}}
      }
    }
    

    那么您应该能够更改版本策略以加载所有可用版本。

    有关更多信息,请参阅this github 问题。

    【讨论】:

    • 您的解决方案正是我所需要的 - 我一直在努力寻找有关 model_config_file 格式/内容的文档,老实说,即使我查看了您引用的 github 源代码,我'我不知道如何将它翻译成文件中的额外行。
    • 是否可以不使用配置列表文件,而只是将其作为参数传递给 tensorflow_model_server?我浏览了这个可执行文件可能采用的参数,但还没有看到。
    猜你喜欢
    • 2019-11-27
    • 2017-07-15
    • 1970-01-01
    • 2017-08-09
    • 1970-01-01
    • 1970-01-01
    • 2018-10-16
    • 2023-02-10
    • 2020-04-13
    相关资源
    最近更新 更多