Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backbone parameter freezing across models #3838

Open
AhmadOudeh opened this issue Jan 22, 2025 · 0 comments
Open

backbone parameter freezing across models #3838

AhmadOudeh opened this issue Jan 22, 2025 · 0 comments

Comments

@AhmadOudeh
Copy link

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
        ...
    )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant