【问题标题】:Unable run Tensorflow Serving using config file无法使用配置文件运行 TensorFlow Serving
【发布时间】:2019-05-08 10:59:32
【问题描述】:

我正在尝试使用配置文件运行 tensorflow/serving docker 映像。它会引发有关 servable 的文件系统访问的错误。我尝试使用单个模型和多个模型都不起作用。

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 &

【问题讨论】:

    标签: tensorflow tensorflow-serving


    【解决方案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"
      },
    }
    

    【讨论】:

      猜你喜欢
      • 2020-12-26
      • 2017-10-24
      • 1970-01-01
      • 2021-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-11
      相关资源
      最近更新 更多