【问题标题】:TensorFlow Serving multiple models via dockerTensorFlow 通过 docker 服务多个模型
【发布时间】:2019-02-18 09:14:11
【问题描述】:

我无法通过 TensorFlow Serving 在 Windows 10 机器上通过 docker 运行 2 个或更多模型。

我已经制作了一个models.config 文件

model_config_list: {

config: {
    name: "ukpred2",
    base_path: "/models/my_models/ukpred2",
    model_platform: "tensorflow"
    },
config: {
    name: "model3",
    base_path: "/models/my_models/ukpred3",
    model_platform: "tensorflow"
    }
}

docker run -p 8501:8501 --mount type=bind,source=C:\Users\th3182\Documents\temp\models\,target=/models/my_models --mount type=bind,source=C:\Users\th3182\Documents\temp\models.config,target=/models/models.config -t tensorflow/serving --model_config_file=/models/models.config

C:\Users\th3182\Documents\temp\models 中有两个文件夹ukpred2ukpred3 在这些文件夹中是从训练模型导出的文件夹,即1536668276,其中包含一个assets 文件夹、一个variables 文件夹和一个saved_model.ph 文件.

我得到的错误是

2018-09-13 15:24:50.567686: I tensorflow_serving/model_servers/main.cc:157] Building single TensorFlow model file config:  model_name: model model_base_path: /models/model
2018-09-13 15:24:50.568209: I tensorflow_serving/model_servers/server_core.cc:462] Adding/updating models.
2018-09-13 15:24:50.568242: I tensorflow_serving/model_servers/server_core.cc:517]  (Re-)adding model: model
2018-09-13 15:24:50.568640: 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 /models/model for servable model

我似乎无法使其与上述更改一起使用。但是我已经设法使用以下命令为单个模型提供服务

docker run -p 8501:8501 --mount type=bind,source=C:\Users\th3182\Documents\projects\Better_Buyer2\model2\export\exporter,target=/models/model2 -e MODEL_NAME=model2 -t tensorflow/serving

【问题讨论】:

    标签: docker tensorflow tensorflow-serving


    【解决方案1】:

    在 tensorflow 服务 2.6.0 中,多个模型的模型服务器配置详细信息:

    model_config_list {
      config {
        name: 'my_first_model'
        base_path: '/tmp/my_first_model/'
        model_platform: 'tensorflow'
      }
      config {
        name: 'my_second_model'
        base_path: '/tmp/my_second_model/'
        model_platform: 'tensorflow'
      }
    }
    

    示例:使用 tensorflow/serving 运行多个模型

    docker run -p 8500:8500 \
    -p 8501:8501 \
    --mount type=bind,source=/tmp/models,target=/models/my_first_model \
    --mount type=bind,source=/tmp/models,target=/models/my_second_model \
    --mount type=bind,source=/tmp/model_config,\
    target=/models/model_config \
    -e MODEL_NAME=my_first_model \
    -t tensorflow/serving \
    --model_config_file=/models/model_config
    

    更多信息请参考Model Server Configuration

    【讨论】:

      【解决方案2】:

      您必须等待下一个版本(1.11.0)来工作。在临时,您可以使用图像tensorflow /服务:夜间或tensorflow /服务:1.11.0-RC0

      【讨论】:

        猜你喜欢
        • 2019-04-01
        • 2019-03-03
        • 2020-03-09
        • 2018-01-26
        • 2020-03-03
        • 2018-11-03
        • 2023-03-06
        • 1970-01-01
        • 2021-03-14
        相关资源
        最近更新 更多