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

AttributeError: 'DataParallel' object has no attribute 'get_embeds' #56

Open
CCRss opened this issue Sep 13, 2023 · 0 comments
Open

AttributeError: 'DataParallel' object has no attribute 'get_embeds' #56

CCRss opened this issue Sep 13, 2023 · 0 comments

Comments

@CCRss
Copy link

CCRss commented Sep 13, 2023

Just want to train own QQP model, started testing.
When training is starting I get this error message.

### Training...
cuda:0
Traceback (most recent call last):
  File "/content/DiffuSeq/train.py", line 115, in <module>
    main()
  File "/content/DiffuSeq/train.py", line 92, in main
    TrainLoop(
  File "/content/DiffuSeq/train_util.py", line 178, in run_loop
    self.run_step(batch, cond)
  File "/content/DiffuSeq/train_util.py", line 197, in run_step
    self.forward_backward(batch, cond)
  File "/content/DiffuSeq/train_util.py", line 255, in forward_backward
    losses = compute_losses()
  File "/content/DiffuSeq/diffuseq/gaussian_diffusion.py", line 937, in training_losses
    return super().training_losses(self._wrap_model(model), *args, **kwargs)
  File "/content/DiffuSeq/diffuseq/gaussian_diffusion.py", line 196, in training_losses
    return self.training_losses_seq2seq(model, *args, **kwargs)
  File "/content/DiffuSeq/diffuseq/gaussian_diffusion.py", line 600, in training_losses_seq2seq
    x_start_mean = model.model.module.get_embeds(input_ids_x)
  File "/usr/local/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'DataParallel' object has no attribute 'get_embeds'

my settings of train.sh

python -m torch.distributed.launch --nproc_per_node=1 --master_port=12233 --use_env run_train.py \
--diff_steps 2 \
--lr 0.0001 \
--learning_steps 20 \
--save_interval 5 \
--seed 102 \
--noise_schedule sqrt \
--hidden_dim 128 \
--bsz 64 \
--dataset qqp \
--data_dir /content/DiffuSeq/datasets/qqp \
--vocab bert \
--seq_len 128 \
--schedule_sampler lossaware \
--notes test-qqp

dataset consist of example

{"src": "wait what was that whoop whoop after the goal announcement ? he sounded like the guy on the whistle tips video", "trg": "the avs play a sound byte after every goal . the woo woo i think is the geico camel ."}
{"src": "this is my favorite story arc . ca n't wait to see how he does in the tourney ! the show is my guarantee smile for the week .", "trg": "yea it 's hard not to have a smile on your face the entire episode"}
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

1 participant