我正在尝试使用张量流服务。但是,任何可供下载的经过预先训练的模型(例如从此处:the TF detection zoo)在saved_models/variables
目录中都没有服务模型所需的任何文件。
如何使用检测模型库中可用的预训练模型来创建saved_models/variables
目录中所需的文件?
有一些信息from the official documentation,但不涵盖我转换要提供的预训练模型的用例。
我尝试过的其他事情是使用tensorflow服务示例。但是,大多数现有文档都以Resent实现为例,并且Tensorflow已删除了resnet的预训练模型。 This is the linked that tutorials use,请注意,没有直接链接可以下载模型。顺便说一句,但又一个有趣的事情是,Tensorflow服务回购中的python示例不适用于Tensorflow 2.0。
看来此链接在转换中可能有用:https://github.com/tensorflow/models/issues/1988
确定,截至编写本文时,对象检测教程仅支持tensorflow 1.12.0。
很难做到这一点,因为它是如此多层,但是您需要:
models/research/object_detection/exporter.py
修补these instructions。或者,您可以使用上述说明的this patch。/path/to/model.ckpt.data-00000-of-00001
,/path/to/model.ckpt.meta
和/path/to/model.ckpt.index
,则传递给脚本的参数为:/path/to/model.ckpt