gpt4 book ai didi

tensorflow - 无法在 tensorflow 服务中加载 pb 文件

转载 作者:行者123 更新时间:2023-12-03 12:33:14 25 4
gpt4 key购买 nike

我已使用 SavedModel (Inception_resnet_v2) 导出 TensorFlow 模型文件并使用 TensorFlow Serving 加载文件。我已将官方 minst saved_model.pb 直接替换为我自己的 Inception_resnet_v2 saved_model.pb 文件。但我遇到了一个错误。

deep@ubuntu:~/serving$ bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server --port=9000 --model_name=mnist --model_base_path=/home/deep/serving/tmp/mnist_model
2017-06-18 10:39:41.963490: I tensorflow_serving/model_servers/main.cc:146] 构建单个 TensorFlow 模型文件配置:model_name:mnist model_base_path:home/deep/serving/tmp/mnist_model model_version_policy:0
2017-06-18 10:39:41.963752:我 tensorflow_serving/model_servers/server_core.cc:375] 添加/更新模型。
2017-06-18 10:39:41.963762:我 tensorflow_serving/model_servers/server_core.cc:421](重新)添加模型:mnist
2017-06-18 10:39:42.065556:我 tensorflow_serving/core/basic_manager.cc:698] 成功保留资源以加载可服务{名称:mnist 版本:1}
2017-06-18 10:39:42.065610: I tensorflow_serving/core/loader_harness.cc:66] 批准可服务版本的负载{名称:mnist 版本:1}
2017-06-18 10:39:42.065648:我 tensorflow_serving/core/loader_harness.cc:74] 加载可服务版本 {名称:mnist 版本:1}
2017-06-18 10:39:42.065896: I external/org_tensorflow/tensorflow/contrib/session_bundle/bundle_shim.cc:360] 尝试在 bundle-shim 中加载 native SavedModelBundle:/home/deep/serving/tmp/mnist_model/1
2017-06-18 10:39:42.066130: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:226] 从/home/deep/serving/tmp/mnist_model/1 加载 SavedModel
2017-06-18 10:39:42.080775:我 external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:274] 加载 SavedModel:失败。耗时 14816 微秒。
2017-06-18 10:39:42.080822:E tensorflow_serving/util/retrier.cc:38] 加载可服务:{名称:mnist 版本:1} 失败:未找到:找不到与提供的标签匹配的元图 def。
我应该怎么办?谢谢!

最佳答案

我和 Serving 工程师聊了聊,以下是他们对此的一些想法:

Looks like they need to specify a tag either in the saved model, or on the command line. (log line of note: failed: Not found: Could not find meta graph def matching supplied tags. )

It looks like the SavedModel loader is unable to find a graph corresponding to the tags they have supplied. Here is some documentation: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/python/saved_model#tags

Ah, to add: They could use the SavedModel CLI to inspect the model and see what tag-sets are available. Here is the documentation for that: https://www.tensorflow.org/versions/master/programmers_guide/saved_model_cli.

They can run

    saved_model_cli show --dir <SavedModelDir> 

to check what tag-sets are in the SavedModel if they have pip installed tensorflow.

关于tensorflow - 无法在 tensorflow 服务中加载 pb 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44611261/

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