Tensorflow 服务 没有可服务的版本<MODEL>在基本路径下找到 [英] Tensorflow serving No versions of servable &lt;MODEL&gt; found under base path

查看:9
本文介绍了Tensorflow 服务 没有可服务的版本<MODEL>在基本路径下找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注 this 使用我的对象检测模型使用 tensorflow 服务 的教程.我正在使用 tensorflow 对象检测 来生成模型.我使用 this 导出器(生成的冻结模型工作使用 python 脚本).

I was following this tutorial to use tensorflow serving using my object detection model. I am using tensorflow object detection for generating the model. I have created a frozen model using this exporter (the generated frozen model works using python script).

冻结图目录有以下内容(variables目录中没有内容)

The frozen graph directory has following contents ( nothing on variables directory)

变量/

saved_model.pb

saved_model.pb

现在,当我尝试使用以下命令为模型提供服务时,

Now when I try to serve the model using the following command,

tensorflow_model_server --port=9000 --model_name=ssd --model_base_path=/serving/ssd_frozen/

它总是显示我

...

tensorflow_serving/model_servers/server_core.cc:421](重新)添加型号:SSD 2017-08-07 10:22:43.892834: Wtensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:262]在基本路径/serving/ssd_frozen/下找不到可用的 ssd 版本2017-08-07 10:22:44.892901:Wtensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:262]在基本路径/serving/ssd_frozen/

tensorflow_serving/model_servers/server_core.cc:421] (Re-)adding model: ssd 2017-08-07 10:22:43.892834: W tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:262] No versions of servable ssd found under base path /serving/ssd_frozen/ 2017-08-07 10:22:44.892901: W tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:262] No versions of servable ssd found under base path /serving/ssd_frozen/

...

推荐答案

我遇到了同样的问题,原因是对象检测 api 在导出您的检测模型时没有分配您的模型版本.但是,tensorflow 服务要求您分配检测模型的版本号,以便您可以选择不同版本的模型进行服务.在您的情况下,您应该将检测模型(.pb 文件和变量文件夹)放在文件夹下:/serving/ssd_frozen/1/.这样,你将你的模型分配到版本 1,tensorflow 服务将自动加载这个版本,因为你只有一个版本.默认tensorflow服务会自动服务最新版本(即最大版本数).

I had same problem, the reason is because object detection api does not assign version of your model when exporting your detection model. However, tensorflow serving requires you to assign a version number of your detection model, so that you could choose different versions of your models to serve. In your case, you should put your detection model(.pb file and variables folder) under folder: /serving/ssd_frozen/1/. In this way, you will assign your model to version 1, and tensorflow serving will automatically load this version since you only have one version. By default tensorflow serving will automatically serve the latest version(ie, the largest number of versions).

注意,创建 1/文件夹后,model_base_path 仍然需要设置为 --model_base_path=/serving/ssd_frozen/.

Note, after you created 1/ folder, the model_base_path is still need to be set to --model_base_path=/serving/ssd_frozen/.

这篇关于Tensorflow 服务 没有可服务的版本<MODEL>在基本路径下找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆