Skip to content

Getting Error while Training #18

Open

Description

@heychhavi

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'

Activity

  1. AI7AxonH commented on Mar 13, 2024

    @AI7AxonH

    I meet the same problem. Do you resolve this?

  2. Henabo commented on May 9, 2024

    @Henabo

    I meet the same problem

  3. Henabo commented on May 9, 2024

    @Henabo

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions