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

Python 3.10 Colab #5

Closed
ziyaad30 opened this issue Oct 3, 2023 · 3 comments
Closed

Python 3.10 Colab #5

ziyaad30 opened this issue Oct 3, 2023 · 3 comments

Comments

@ziyaad30
Copy link

ziyaad30 commented Oct 3, 2023

RuntimeError: Error(s) in loading state_dict for CustomAlbert:
Unexpected key(s) in state_dict: "embeddings.position_ids".

@teopapad92
Copy link

teopapad92 commented Oct 3, 2023

In Utils/PLBERT/utils.py, delete the check

from:

if not hasattr(bert.embeddings, 'position_ids'):
    del new_state_dict["embeddings.position_ids"]
bert.load_state_dict(new_state_dict)

to:

# if not hasattr(bert.embeddings, 'position_ids'):
del new_state_dict["embeddings.position_ids"]
bert.load_state_dict(new_state_dict)

@ziyaad30
Copy link
Author

ziyaad30 commented Oct 3, 2023

In Utils/PLBERT/utils.py, delete the check

from:

if not hasattr(bert.embeddings, 'position_ids'):
    del new_state_dict["embeddings.position_ids"]
bert.load_state_dict(new_state_dict)

to:

# if not hasattr(bert.embeddings, 'position_ids'):
del new_state_dict["embeddings.position_ids"]
bert.load_state_dict(new_state_dict)

Thank you, Ill give it a go and test.

@ziyaad30
Copy link
Author

ziyaad30 commented Oct 3, 2023

It worked and closing, I can see this is still in early development.

@ziyaad30 ziyaad30 closed this as completed Oct 3, 2023
yl4579 added a commit that referenced this issue Oct 3, 2023
fix issue #5
Akito-UzukiP pushed a commit to Akito-UzukiP/StyleTTS2 that referenced this issue Jan 13, 2024
nawed2611 pushed a commit to team-listnr/StyleTTS2 that referenced this issue Feb 8, 2024
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

2 participants