Tensorflow服务错误,服务于Tensorflow 1.5版模型

问题描述 投票:0回答:1

[在Docker容器中运行Tensorflow Serving时获得以下错误消息

2019-12-12 03:25:13.947401: I tensorflow_serving/model_servers/server.cc:85] Building single TensorFlow model file config:  model_name: mymodel model_base_path: /models/mymodel 
2019-12-12 03:25:13.947870: I tensorflow_serving/model_servers/server_core.cc:462] Adding/updating models.
2019-12-12 03:25:13.947891: I tensorflow_serving/model_servers/server_core.cc:573]  (Re-)adding model: mymodel
2019-12-12 03:25:14.058166: I tensorflow_serving/core/basic_manager.cc:739] Successfully reserved resources to load servable {name: mymodel version: 1}
2019-12-12 03:25:14.058430: I tensorflow_serving/core/loader_harness.cc:66] Approving load for servable version {name: mymodel version: 1}
2019-12-12 03:25:14.059106: I tensorflow_serving/core/loader_harness.cc:74] Loading servable version {name: mymodel version: 1}
2019-12-12 03:25:14.064459: E tensorflow_serving/util/retrier.cc:37] Loading servable: {name: mymodel  version: 1} failed: Not found: Specified file path does not appear to contain a SavedModel bundle (should have a file called `saved_model.pb`)
Specified file path: /models/mymodel/1

该模型是​​使用tensorflow v1.5构建的,没有* .pb文件。是否可以运行此版本的tensorflow模型?任何想法表示赞赏。预先感谢。

tensorflow tensorflow-serving
1个回答
0
投票

是的,您可以在tfserving上部署在Tensorflow v1.5上训练的模型。

TfServing需要SavedModel格式。

可能您的训练脚本可能存在一些配置问题。

(但是很难弄清楚,因为您还没有提供代码,请始终尝试将代码包含在SO的问题中,以便对其他人有更好的理解)


回答您的问题,

要获取SavedModel格式,请通过official script训练模型。

训练后,您将在指定的模型目录中获得以下目录结构。

<model_dir> | |----- variables | |------- variables.data-00000-of-00001 | |------- variables.index | |----- saved_model.pb

然后您可以直接指定tfserving的<model_dir>路径,它将使用此模型。
© www.soinside.com 2019 - 2024. All rights reserved.