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

问题描述

我正在关注教程使用我的对象检测模型使用 tensorflow服务。我正在使用生成模型。我使用导出器(生成的冻结模型有效使用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).

冻结图目录具有以下内容(变量目录)

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:W
tensorflow_serving / sources / storage_path / file_system_storage_path_source.cc:262]
在基本路径/ serving / ssd_frozen /
下找不到可使用的ssd版本2017-08-07 10:22:44.892901:W
tensorflow_serving / sources / storage_path / file_system_storage_path_source.cc:262]
在基本路径/ serving / ssd_frozen /

tensorflow_serving/model_servers/server_core.cc:421] (Re-)addingmodel: ssd 2017-08-07 10:22:43.892834: Wtensorflow_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: Wtensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:262]No versions of servable ssd found under base path /serving/ssd_frozen/

...


推荐答案

我遇到了同样的问题,原因这是因为在导出检测模型时,对象检测api不会分配模型的版本。但是,张量流服务要求您分配检测模型的版本号,以便您可以选择要服务的模型的不同版本。对于您的情况,应该将检测模型(.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>版本在基本路径下找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 21:21