gpt4 book ai didi

docker - 使用 docker 提供多个 tensorflow 模型

转载 作者:行者123 更新时间:2023-12-02 09:42:30 25 4
gpt4 key购买 nike

看过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: {}
}
}
}

最佳答案

我遇到了this Windows 上 git bash 的双斜杠问题。

因此,我通过 docker-compose 中的 command 传递 @KrisR89 提到的参数。

新的docker-compose看起来像这样,并与提供的dockerfile一起使用:

version: '3'

services:
serving:
build: .
image: testing-models
container_name: tf
command: --model_config_file=/config/config.conf

关于docker - 使用 docker 提供多个 tensorflow 模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53035896/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com