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

Fix MAE Initialization #182

Merged

Conversation

anwai98
Copy link
Contributor

@anwai98 anwai98 commented Dec 10, 2023

No description provided.


# let's remove the `head` from our current encoder (as the MAE pretrained don't expect it)
current_encoder_state = self.encoder.state_dict()
if "head.weight" and "head.bias" in current_encoder_state:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only checks if "head.bias" in current_encoder_state. "head.weight" is evaluated as an independent expression and will always evaluate to True.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my bad. I just overlooked it. Thanks for pointing. It's fixed now!

@constantinpape
Copy link
Owner

Thanks for figuring it out! There's a minor issue in the code to fix.

More general: it's a bit unfortunate that we hard-code the image size like this, but I think we can't do much about this for now; I will create a more long term issue on that later.

@constantinpape constantinpape merged commit 8b27b49 into constantinpape:more-loss-updates Dec 10, 2023
2 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants