[英]Wrong frozen graph export from Tensorflow Object Detection API zoo model
I am working with Mask R CNN model using Tensorflow Object Detection API project ( https://github.com/tensorflow/models/tree/r1.12.0/research/object_detection ). 我正在使用Tensorflow Object Detection API项目( https://github.com/tensorflow/models/tree/r1.12.0/research/object_detection )使用Mask R CNN模型。 I stick to r1.12.0 release (but this is not a must but I do not think it influences my problem.) My plan is to modify some "static" parts of the model and export it again into the frozen graph format.
我坚持使用r1.12.0版本(但这不是必须的,但我不认为它会影响我的问题。)我的计划是修改模型的某些“静态”部分并将其再次导出为冻结图形格式。
As a first step, I meant to regenerate the frozen graph from the checkpoints file and the pipeline.config
using export_inference_graph.py
script ( https://github.com/tensorflow/models/blob/r1.12.0/research/object_detection/export_inference_graph.py ). 作为第一步,我打算使用
export_inference_graph.py
脚本从checkpoints文件和pipeline.config
重新生成冻结图( https://github.com/tensorflow/models/blob/r1.12.0/research/object_detection/export_inference_graph .py )。 I downloaded the inception V2 model ( http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_v2_coco_2018_01_28.tar.gz ) and executed the script using Tensorflow 1.12.0. 我下载了初始V2模型( http://download.tensorflow.org/models/object_detection/mask_rcnn_inception_v2_coco_2018_01_28.tar.gz )并使用Tensorflow 1.12.0执行了该脚本。 It does the job and creates a frozen graph.
它完成了工作并创建了冻结图。
The issue is that if I compare the original frozen graph with the generated one, they are different. 问题是如果我将原始的冻结图与生成的图进行比较,它们就不同了。 If I visualize them using Tensorboard there are obvious differences between them.
如果我使用Tensorboard对它们进行可视化,则它们之间存在明显的差异。 Some nodes are missing, some nodes are different etc.
一些节点丢失,某些节点不同等等。
I have tried other models as well (normal Fast R CNN), I had the same issue always. 我也尝试过其他模型(正常的Fast R CNN),但始终遇到相同的问题。
How can this be? 怎么会这样? How should I use the checkpoint files and the
pipeline.config
file to regenerate exactly the same frozen graph which is originally attached? 我应该如何使用检查点文件和
pipeline.config
文件重新生成最初附加的完全相同的冻结图?
As far as I understood it, your steps of generating frozen graph is fine. 据我了解,您生成冻结图的步骤很好。
One thing about frozen graph is that optimizations can be performed on it, for example fuse some layers together. 关于冻结图的一件事是可以对其执行优化,例如将一些层融合在一起。 Optimization may cause your frozen graph to look different as different optimizations could be performed or non at all.
优化可能会导致冻结的图看起来不同,因为可以执行或根本不执行不同的优化。 But different frozen graph does not necessarily mean the graph is wrongly generated.
但是不同的冻结图并不一定意味着图形被错误地生成。
Here is a tutorial on optimizations on frozen graph to make a faster serving model. 这是有关冻结图优化的教程,以创建更快的投放模型。 Just listed here to show that there are several optimization options.
仅在此处列出以显示有几个优化选项。
Here What does freezing a graph in TensorFlow mean? 冻结TensorFlow中的图形意味着什么? is another problem that is also kind of related to this problem.
是另一个与此问题相关的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.