【问题标题】:Which layers are frozen using Tensorflow 2 Object detection API?使用 Tensorflow 2 对象检测 API 冻结了哪些层?
【发布时间】:2021-12-18 16:26:52
【问题描述】:

如何从 Tensorflow Model Zoo 2 中了解哪些层被冻结微调检测模型? 我已经成功设置了 Fine_tune_checkpoint 和 fine_tune_checkpoint_type: detection 的路径,并且在文件 proto 中我已经阅读了“检测”的意思

// 2. "detection": Restores the entire feature extractor.
The only parts of the full detection model that are not restored are the box and class prediction heads. 
This option is typically used when you want to use a pre-trained detection model 
and train on a new dataset or task which requires different box and class prediction heads.

我真的不明白这是什么意思。在这种情况下,恢复意味着冻结?

【问题讨论】:

    标签: tensorflow object-detection


    【解决方案1】:

    据我了解,目前 Tensorflow 2 对象检测在从微调检查点进行训练时不会冻结任何层。报告了一个问题 here 以支持在管道配置中指定要冻结的层。如果您查看training step function,您可以看到在训练期间应用梯度时使用了所有可训练变量。

    这里的恢复意味着模型权重是从检查点复制过来的,作为训练的起点。冻结意味着在训练期间权重没有改变(即没有应用梯度)。

    【讨论】:

    • 好的,你知道在这种情况下哪些层必须被冻结吗?我想对两个微调模型的新类进行对象检测,但我没有很多数据。
    • 我应该提到,管道配置确实支持冻结批量标准化层,这显然是微调的常见做法。没有层必须被冻结。我建议在对象检测 API 示例中查看此 example project。在该示例中,作者恢复了比主要对象检测包中更多的检查点,并且还选择在训练中冻结大多数层。
    • 是的,我读到微调不需要冻结任何层,但它只是利用在更大数据集上初始化的权重和配置,ty。
    猜你喜欢
    • 2021-09-24
    • 1970-01-01
    • 1970-01-01
    • 2019-09-21
    • 1970-01-01
    • 2021-02-01
    • 2020-10-10
    • 2022-07-02
    • 1970-01-01
    相关资源
    最近更新 更多