Skip to content

backbone parameter freezing across models #3838

Open
@AhmadOudeh

Description

@AhmadOudeh

Description

There seems to be inconsistency in how different models handle backbone parameter freezing. Some models (like SwinTransformer) have a clear mechanism through frozen_stages parameter and _freeze_stages() method, while others (like FastSCNN) lack this functionality. This makes it difficult to have a consistent approach to transfer learning across different architectures.

Current State

  1. Some models implement freezing through:

    • frozen_stages config parameter
    • _freeze_stages() method
    • Built-in parameter freezing logic
  2. Other models (like FastSCNN) don't have these mechanisms, making it unclear how to:

    • Freeze specific layers
    • Control freezing through configs
    • Implement transfer learning consistently

Question

  1. What's the recommended way to freeze backbone parameters in FastSCNN?
  2. Should I manually set requires_grad=False for parameters, or is there a config-based solution?

Example

Using FastSCNN as an example:

# In SwinTransformer, we can do:
model = dict(
    backbone=dict(
        type='SwinTransformer',
        frozen_stages=2,
        ...
    )
)

# But in FastSCNN, there's no equivalent:
model = dict(
    backbone=dict(
        type='FastSCNN',
        # No frozen_stages parameter
        ...
    )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions