[英]Understanding Tensorflow Object-Detection API, kwargs for Checkpoint class, what is `_base_tower_layers_for_heads`?
Currently, I've been learning how to use Object-Detection API from Tensorflow.目前,我一直在学习如何使用 Tensorflow 中的 Object-Detection API。 I follow a quick start tutorial for training with custom data with this notebook as suggested by them.
我按照他们的建议使用此笔记本使用自定义数据进行培训的快速入门教程。 In the effort to understanding each line of the code, I stumbled upon this snippet code in the "Create Model and Restore Weight" part.
为了理解代码的每一行,我在“创建 Model 并恢复权重”部分中偶然发现了这段代码。
fake_box_predictor = tf.compat.v2.train.Checkpoint(
_base_tower_layers_for_heads=detection_model._box_predictor._base_tower_layers_for_heads,
# _prediction_heads=detection_model._box_predictor._prediction_heads,
# (i.e., the classification head that we *will not* restore)
_box_prediction_head=detection_model._box_predictor._box_prediction_head,
)
I don't really understand what are the keyword arguments that are available for the Checkpoint
class in that particular snippet code.我真的不明白该特定代码段中可用于
Checkpoint
class 的关键字 arguments 是什么。 My question is;我的问题是; is there any documentation out there that shows the list of the keyword arguments?
是否有任何文档显示关键字 arguments 的列表? or at least explain what are
_base_tower_layers_for_heads
and _box_prediction_head
?或者至少解释什么是
_base_tower_layers_for_heads
和_box_prediction_head
?
I've read the tf.train.Checkpoint
documentation .我已阅读
tf.train.Checkpoint
文档。 It says that we can provide models
or optimizers
for the constructor's keyword argument.它说我们可以为构造函数的关键字参数提供
models
或optimizers
。 I am already familiar with this class to restore the weights to my model, however, I find it is alien to see _base_tower_layers_for_heads
or _box_prediction_head
for the keyword argument.我已经熟悉这个 class 来恢复我的 model 的权重,但是,我发现看到关键字参数的
_base_tower_layers_for_heads
或_box_prediction_head
是陌生的。
I do know about 'heads' and different types of 'heads' in the object detection architecture and their relation to transfer learning, what I don't understand is in the context of their data structure.我确实知道 object 检测架构中的“头”和不同类型的“头”以及它们与迁移学习的关系,但我不了解的是它们的数据结构。 How do I know, these keyword arguments exist?
我怎么知道,这些关键字 arguments 存在? and is there any other else?
还有其他的吗? I would really appreciate it if somebody could give me insights or at least tell me where can I find documentation that I can read to understand it more.
如果有人能给我一些见解,或者至少告诉我在哪里可以找到我可以阅读以进一步理解它的文档,我将不胜感激。
I found pretty useful information about Checkpoint
class.我发现了有关
Checkpoint
class 的非常有用的信息。 It does not come from the documentation but from the tutorial, Training Checkpoints > Loading Mechanism .它不是来自文档,而是来自教程Training Checkpoints > Loading Mechanism 。
This is what I understand so far:这是我目前所理解的:
If we want to know what are the attributes that are saved in our checkpoint file, we can run this command如果我们想知道我们的检查点文件中保存的属性是什么,我们可以运行这个命令
tf.train.list_variables(tf.train.latest_checkpoint('path_to_checkpoint'))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.