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

[Question] 运行twitter-17-txt.yaml和twitter-17-img.yaml出错 #33

Open
1 task done
qingxiangNo1 opened this issue Sep 27, 2023 · 1 comment
Open
1 task done
Labels
question Further information is requested

Comments

@qingxiangNo1
Copy link

What is your question?

运行twitter-17-txt.yaml和twitter-17-img.yaml出错

What have you tried?

No response

Code (if necessary)

Traceback (most recent call last):
File "/home/nlp/.pycharm_helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/nlp/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/nlp/code/AdaSeq/examples/MoRe/train.py", line 37, in
train_model_from_args(args)
File "/home/nlp/code/AdaSeq/adaseq/commands/train.py", line 93, in train_model_from_args
checkpoint_path=args.checkpoint_path,
File "/home/nlp/code/AdaSeq/adaseq/commands/train.py", line 164, in train_model
trainer.train(checkpoint_path)
File "/home/nlp/code/AdaSeq/adaseq/training/default_trainer.py", line 146, in train
return super().train(checkpoint_path=checkpoint_path, *args, **kwargs)
File "/home/nlp/anaconda3/envs/MoRe/lib/python3.7/site-packages/modelscope/trainers/trainer.py", line 676, in train
self.train_loop(self.train_dataloader)
File "/home/nlp/anaconda3/envs/MoRe/lib/python3.7/site-packages/modelscope/trainers/trainer.py", line 1171, in train_loop
self.train_step(self.model, data_batch, **kwargs)
File "/home/nlp/anaconda3/envs/MoRe/lib/python3.7/site-packages/modelscope/trainers/trainer.py", line 841, in train_step
train_outputs = model.forward(**inputs)
File "/home/nlp/code/AdaSeq/adaseq/models/sequence_labeling_model.py", line 129, in forward
loss = self._calculate_loss(logits, label_ids, crf_mask)
File "/home/nlp/code/AdaSeq/adaseq/models/sequence_labeling_model.py", line 176, in _calculate_loss
targets = targets * mask
RuntimeError: The size of tensor a (269) must match the size of tensor b (270) at non-singleton dimension 1

Traceback (most recent call last):
File "/home/nlp/.pycharm_helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/nlp/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/nlp/code/AdaSeq/examples/MoRe/train.py", line 37, in
train_model_from_args(args)
File "/home/nlp/code/AdaSeq/adaseq/commands/train.py", line 93, in train_model_from_args
checkpoint_path=args.checkpoint_path,
File "/home/nlp/code/AdaSeq/adaseq/commands/train.py", line 164, in train_model
trainer.train(checkpoint_path)
File "/home/nlp/code/AdaSeq/adaseq/training/default_trainer.py", line 146, in train
return super().train(checkpoint_path=checkpoint_path, *args, **kwargs)
File "/home/nlp/anaconda3/envs/MoRe/lib/python3.7/site-packages/modelscope/trainers/trainer.py", line 676, in train
self.train_loop(self.train_dataloader)
File "/home/nlp/anaconda3/envs/MoRe/lib/python3.7/site-packages/modelscope/trainers/trainer.py", line 1171, in train_loop
self.train_step(self.model, data_batch, **kwargs)
File "/home/nlp/anaconda3/envs/MoRe/lib/python3.7/site-packages/modelscope/trainers/trainer.py", line 841, in train_step
train_outputs = model.forward(**inputs)
File "/home/nlp/code/AdaSeq/adaseq/models/sequence_labeling_model.py", line 129, in forward
loss = self._calculate_loss(logits, label_ids, crf_mask)
File "/home/nlp/code/AdaSeq/adaseq/models/sequence_labeling_model.py", line 176, in _calculate_loss
targets = targets * mask
RuntimeError: The size of tensor a (299) must match the size of tensor b (300) at non-singleton dimension 1

请问这个问题如何解决

What's your environment?

  • AdaSeq Version (e.g., 1.0 or master):
  • ModelScope Version (e.g., 1.0 or master):
  • PyTorch Version (e.g., 1.12.1):
  • OS (e.g., Ubuntu 20.04):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Code of Conduct

  • I agree to follow this project's Code of Conduct
@qingxiangNo1 qingxiangNo1 added the question Further information is requested label Sep 27, 2023
@qingxiangNo1 qingxiangNo1 changed the title [Question] [Question] 运行twitter-17-txt.yaml和twitter-17-img.yaml出错 Sep 27, 2023
@ccyeol
Copy link

ccyeol commented Jun 23, 2024

I encountered the same problem, how did you solve it in the end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants