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

About the problems encountered when reproducing #62

Closed
loknini opened this issue Feb 22, 2025 · 2 comments
Closed

About the problems encountered when reproducing #62

loknini opened this issue Feb 22, 2025 · 2 comments

Comments

@loknini
Copy link

loknini commented Feb 22, 2025

This is great work, I ran into a problem while trying to reproduce it.
This line of code in modeling_showo in the models folder:
self.showo.resize_token_embeddings(self.vocab_size)
It keeps giving me errors, and the error message is as follows. Can anyone help me solve this problem?

`Traceback (most recent call last):
File "/mnt/d/emoemo/models/showo/inf_mmu_test.py", line 37, in
model = Showo.from_pretrained(config.model.showo.pretrained_model_path).to(device)
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/mnt/d/emoemo/models/showo/showo_models/modeling_utils.py", line 732, in from_pretrained
model = cls.from_config(config, **unused_kwargs)
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 260, in from_config
model = cls(**init_dict)
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 653, in inner_init
init(self, *args, **init_kwargs)
File "/mnt/d/emoemo/models/showo/showo_models/modeling_showo.py", line 41, in init
self.showo.resize_token_embeddings(self.vocab_size)
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2109, in resize_token_embeddings
model_embeds = self._resize_token_embeddings(new_num_tokens, pad_to_multiple_of, mean_resizing)
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2134, in _resize_token_embeddings
new_embeddings = self._get_resized_embeddings(
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2291, in _get_resized_embeddings
self._init_added_embeddings_weights_with_mean(
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2470, in _init_added_embeddings_weights_with_mean
is_covariance_psd = constraints.positive_definite.check(epsilon * covariance).all()
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/torch/distributions/constraints.py", line 578, in check
sym_check = super().check(value)
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/torch/distributions/constraints.py", line 555, in check
if not square_check.all():
File "/mnt/d/anaconda3/envs/emo/lib/python3.10/site-packages/torch/_meta_registrations.py", line 6471, in meta_local_scalar_dense
raise RuntimeError("Tensor.item() cannot be called on meta tensors")
RuntimeError: Tensor.item() cannot be called on meta tensors

进程已结束,退出代码1
`

@Sierkinhane
Copy link
Collaborator

Have you solved this problem? It's weird. I'm unsure if this problem is caused by the version conflicts of some packages.

@loknini
Copy link
Author

loknini commented Feb 25, 2025

Thank you for your reply, I have solved this problem. I just adjusted the version of the transformers library to match your project requirements.

@loknini loknini closed this as completed Feb 25, 2025
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