我已经使用SavedModel(Inception_resnet_v2)导出TensorFlow模型文件并使用TensorFlow服务来加载文件.我已经用我自己的Inception_resnet_v2 saved_model.pb文件直接替换了官方最小的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] Building single TensorFlow model file config: model_name: mnist model_base_path: home/deep/serving/tmp/mnist_model model_version_policy: 0
2017-06-18 10:39:41.963752: I tensorflow_serving/model_servers/server_core.cc:375] Adding/updating models.
2017-06-18 10:39:41.963762: I tensorflow_serving/model_servers/server_core.cc:421] (Re-)adding model: mnist
2017-06-18 10:39:42.065556: I tensorflow_serving/core/basic_manager.cc:698] Successfully reserved resources to load servable {name: mnist version: 1}
2017-06-18 10:39:42.065610: I tensorflow_serving/core/loader_harness.cc:66] Approving load for servable version {name: mnist version: 1}
2017-06-18 10:39:42.065648: I tensorflow_serving/core/loader_harness.cc:74] Loading servable version {name: mnist version: 1}
2017-06-18 10:39:42.065896: I external/org_tensorflow/tensorflow/contrib/session_bundle/bundle_shim.cc:360] Attempting to load native SavedModelBundle in bundle-shim from: /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] Loading SavedModel from: /home/deep/serving/tmp/mnist_model/1
2017-06-18 10:39:42.080775: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:274] Loading SavedModel: fail. Took 14816 microseconds.
2017-06-18 10:39:42.080822: E tensorflow_serving/util/retrier.cc:38] Loading servable: {name: mnist version: 1} failed: Not found: Could not find meta graph def matching supplied tags.
我该怎么办?谢谢!
我和服务工程师聊了聊,以下是他们对此的一些看法:
看起来他们需要在保存的模型或命令行中指定标记.(记录日志:失败:未找到:找不到元图def def匹配提供的标签.)
看起来SavedModel加载器无法找到与它们提供的标记相对应的图形.以下是一些文档:https: //github.com/tensorflow/tensorflow/tree/master/tensorflow/python/saved_model#tags
啊,添加:他们可以使用SavedModel CLI检查模型并查看可用的标记集.以下是相关文档:https: //www.tensorflow.org/versions/master/programmers_guide/saved_model_cli.
他们可以跑
saved_model_cli show --dir检查SavedModel中的标签集是否有pip安装的tensorflow.