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

Weird error when finetuning using colab in repo #36

Closed
Shiro836 opened this issue Nov 19, 2023 · 1 comment
Closed

Weird error when finetuning using colab in repo #36

Shiro836 opened this issue Nov 19, 2023 · 1 comment

Comments

@Shiro836
Copy link

Shiro836 commented Nov 19, 2023

Weird error when finetuning. I tried to put 'embeddings' in ignore_modules but it didn't change anything.

bert
bert loaded
Traceback (most recent call last):
  File "train_finetune.py", line 714, in <module>
    main()
  File "/home/shiro/miniconda3/envs/styletts_fine/lib/python3.7/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/shiro/miniconda3/envs/styletts_fine/lib/python3.7/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/shiro/miniconda3/envs/styletts_fine/lib/python3.7/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/shiro/miniconda3/envs/styletts_fine/lib/python3.7/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "train_finetune.py", line 212, in main
    load_only_params=config.get('load_only_params', True))
  File "/data/Repos/Forsen2/StyleTTS2/models.py", line 703, in load_checkpoint
    model[key].load_state_dict(params[key])
  File "/home/shiro/miniconda3/envs/styletts_fine/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1672, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for MyDataParallel:
	Missing key(s) in state_dict: "module.embeddings.position_ids". 
@yl4579
Copy link
Owner

yl4579 commented Nov 19, 2023

If you are running the notebook on Colab it should not happen, but it seems your transformers package is of an older version. I have fixed it for compatibility of older versions. Basically you need to modify the load models to not load them in strict mode.

@yl4579 yl4579 closed this as completed Nov 19, 2023
Akito-UzukiP pushed a commit to Akito-UzukiP/StyleTTS2 that referenced this issue Jan 13, 2024
* decrease layers

* Update README.md

* Update README.md
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