Failed to start server. Error: Invalid argument

Failed to start server. Error: Invalid argument

我目前正在使用 TensorFlow 服务,运行 执行命令时遇到错误

第 1 步:- 我使用

提取了 tensorflow/serving 图像
docker pull tensorflow/pull

第 2 步:- 我创建了一个项目,将 TF 模型保存在一个目录中:

C:/Code/potato-disease:

第 3 步:- 在 运行 命令之后:-

docker run -t --rm -p 8505:8505 -v C:/Code/potato-disease:/potato-disease tensorflow/serving --rest_api_port=8505 --model_config_file=/potato-disease/models.config

错误:-

Failed to start server. Error: Invalid argument: Expected model potatoes_model to have an absolute path or URI; got base_path()=C:/Code/potato-disease/saved_models
2022-03-16 03:21:46.161233: I tensorflow_serving/core/basic_manager.cc:279] Unload all remaining servables in the manager.

我的models.config文件

model_config_list {
 config {
    name: 'potatoes_model'
    base_path: 'C:/Code/potato-disease/saved_models'
    model_platform: 'tensorflow'
    model_version_policy: {all: {}}
        }
}

您应该编辑您的 models.config 配置并将 /potato-disease/saved_models 作为 base_path 因为它将是 docker 来解释您的代码它应该有适当的参数取决于它的环境,因为它是 运行 在 docker 里面,绝对路径应该考虑到这一点。