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

Getting Error while Training #18

Open
heychhavi opened this issue Dec 23, 2023 · 3 comments
Open

Getting Error while Training #18

heychhavi opened this issue Dec 23, 2023 · 3 comments

Comments

@heychhavi
Copy link

When I am trying to run this

bash scripts/run_train.sh greetings 1 False False False 1

I am getting the below error:
Training: 0% 0/1 [00:00<?, ?it/s]INFO:root:Reading data from data/greetings-train.txt
INFO:root:Tokenizing 298 sentences
Traceback (most recent call last):
File "/content/gdrive/MyDrive/minimal-text-diffusion/src/train_infer/train.py", line 117, in
main()
File "/content/gdrive/MyDrive/minimal-text-diffusion/src/train_infer/train.py", line 106, in main
).run_loop()
^^^^^^^^^^
File "/content/gdrive/MyDrive/minimal-text-diffusion/src/train_infer/train_loop.py", line 186, in run_loop
self.run_step(batch, cond)
File "/content/gdrive/MyDrive/minimal-text-diffusion/src/train_infer/train_loop.py", line 206, in run_step
self.forward_backward(batch, cond)
File "/content/gdrive/MyDrive/minimal-text-diffusion/src/train_infer/train_loop.py", line 268, in forward_backward
losses = compute_losses()
^^^^^^^^^^^^^^^^
File "/content/gdrive/MyDrive/minimal-text-diffusion/src/modeling/diffusion/respace.py", line 99, in training_losses
return super().training_losses(self._wrap_model(model), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/content/gdrive/MyDrive/minimal-text-diffusion/src/modeling/diffusion/gaussian_diffusion.py", line 246, in training_losses
x_start_mean = model.model.module.get_embeds(input_ids)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1695, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'TransformerNetModel' object has no attribute 'module'

@AI7Xiao
Copy link

AI7Xiao commented Mar 13, 2024

I meet the same problem. Do you resolve this?

@Henabo
Copy link

Henabo commented May 9, 2024

I meet the same problem

@Henabo
Copy link

Henabo commented May 9, 2024

I solved the problem, because you are running the model with the cpu, so you need to remove the "module" to solve the problem in the gaussian_diffusion.py. such as "x_start_mean = model.model.get_embeds(input_ids)". You won't have this problem if you're running on a gpu.

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

3 participants