Skip to content

Conversation

@NielsRogge
Copy link
Contributor

What does this PR do?

This PR is a follow-up of #19341, to make sure weights are properly initialized when training vision models from scratch.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Looking good! Just a few comments on updating the TF models and initialization calls in inits.

Copy link
Contributor

Choose a reason for hiding this comment

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

How come it's only the VIT model that has these tests skipped?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make the equivalent initialization updates in the TF model?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make the equivalent initialization updates in the TF model?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make the equivalent updates for the TF model?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you might need the post_init() call here

Suggested change
self.config = config
self.config = config
# Initialize weights and apply final processing
self.post_init()
Copy link
Contributor

Choose a reason for hiding this comment

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

And possibly here

Suggested change
self.num_patches = num_patches
# Initialize weights and apply final processing
self.post_init()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd move this up out of the for-loop as it doesn't need to be redefined for each parameter

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot closed this Dec 4, 2022
@NielsRogge NielsRogge reopened this Dec 5, 2022
@NielsRogge NielsRogge added the WIP Label your PR/Issue with WIP for some long outstanding Issues/PRs that are work in progress label Dec 5, 2022
@Phuoc-Hoan-Le
Copy link

Any further updates? @NielsRogge @amyeroberts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Label your PR/Issue with WIP for some long outstanding Issues/PRs that are work in progress

5 participants