【发布时间】:2019-04-01 19:37:57
【问题描述】:
看到this github 问题和this stackoverflow 帖子,我希望这能简单地工作。
似乎传入环境变量MODEL_CONFIG_FILE 没有任何影响。我正在通过docker-compose 运行它,但我使用docker-run 遇到了同样的问题。
错误:
I tensorflow_serving/model_servers/server.cc:82] Building single TensorFlow model file config: model_name: model model_base_path: /models/model
I tensorflow_serving/model_servers/server_core.cc:461] Adding/updating models.
I tensorflow_serving/model_servers/server_core.cc:558] (Re-)adding model: model
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
Dockerfile
FROM tensorflow/serving:nightly
COPY ./models/first/ /models/first
COPY ./models/second/ /models/second
COPY ./config.conf /config/config.conf
ENV MODEL_CONFIG_FILE=/config/config.conf
撰写文件
version: '3'
services:
serving:
build: .
image: testing-models
container_name: tf
配置文件
model_config_list: {
config: {
name: "first",
base_path: "/models/first",
model_platform: "tensorflow",
model_version_policy: {
all: {}
}
},
config: {
name: "second",
base_path: "/models/second",
model_platform: "tensorflow",
model_version_policy: {
all: {}
}
}
}
【问题讨论】:
-
10 月 5 日之后,您不必再使用 nightly 了,因为最新的 tensorflow-serving 现在支持配置文件,如 here 所述
-
@krisR89 这一切都很好,但不管怎样都行不通。
-
在 tensorflow 服务中,默认的 MODEL_NAME 是“model”,而 MODEL_BASE_PATH 是“/models”。由于某种原因,您的模型不运行配置文件,而只运行默认的“/models/model”。我猜你有两个问题之一。旧份图像或图像未正确激活。我会尝试“docker pull tensorflow/serving”来获取 laset 版本。如果出现问题,您能否添加运行 docker image fil(命令)的方式?
-
@KrisR89 在测试期间我明确使用
:1.11.0-rc0作为图像,如您链接的问题中所述,即带有这些更改的修订版。我运行了docker image prune -a以确保我始终拥有最新的图像。我使用的命令是docker-compose build,后跟docker-compose up。问题如上所述。我唯一能想到的是环境变量在某种程度上没有被图像所尊重。
标签: docker docker-compose dockerfile tensorflow-serving