无法使用配置文件运行Tensorflow服务

时间:2019-05-08 10:59:33

标签: tensorflow-serving multiple-models

我正在尝试使用配置文件运行tensorflow / serving docker镜像。它抛出有关文件系统访问错误的消息。我尝试使用单个模型和多个模型都不起作用。

泊坞窗执行命令如下

sudo docker run -p 8501:8501 --mount type=bind,source=/home/projects/models/model1/,target=/models/model1 --mount type=bind,source=/home/projects/models/model2/,target=/models/model2 --mount type=bind,source=/home/projects/config.conf,target=/models/config.conf -t tensorflow/serving --model_config_file=/models/config.conf

 "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 /home/projects/models/model1/ for servable model1
"

我的配置文件如下

model_config_list {
 config {
    name: 'model1',
    base_path: '/home/projects/models/model1/',
    model_platform: 'tensorflow'
  }
  config {
    name: 'model2',
    base_path: '/home/projects/models/model2/',
    model_platform: "tensorflow"
  }

}

但是无需使用配置文件,我可以使用docker命令单独运行模型。

sudo docker run -t --rm -p 8501:8501    -v "/home/projects/models/model1:/models/model1"     -e MODEL_NAME=model1     tensorflow/serving &

1 个答案:

答案 0 :(得分:1)

无需分别安装每个型号!您可以像这样安装所有模型:

sudo docker run \
-p 8501:8501 \
--mount type=bind,source=/home/projects/models/,target=/models/ \
-t tensorflow/serving \
--model_config_file=/models/config.conf

,您的config.conf文件现在看起来像这样(将此文件放在/home/projects/models/下):

model_config_list {
  config {
    name: 'model1',
    base_path: '/models/model1',
    model_platform: 'tensorflow'
  },
  config {
    name: 'model2',
    base_path: '/models/model2',
    model_platform: "tensorflow"
  },
}