DiffuSeq icon indicating copy to clipboard operation
DiffuSeq copied to clipboard

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

Open vladimiralbrekhtccr opened this issue 2 years ago • 0 comments

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"}

vladimiralbrekhtccr avatar Sep 13 '23 12:09 vladimiralbrekhtccr