raceback (most recent call last):
File "d:\tempinformation\ConferenceSummary\train.py", line 129, in <module>
train_result = trainer.train()
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\transformers\trainer.py", line 1555, in train
return inner_training_loop(
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\transformers\trainer.py", line 1837, in _inner_training_loop
tr_loss_step = self.training_step(model, inputs)
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\transformers\trainer.py", line 2682, in training_step
loss = self.compute_loss(model, inputs)
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\transformers\trainer.py", line 2707, in compute_loss
outputs = model(**inputs)
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\transformers\models\bart\modeling_bart.py", line 1413, in forward
masked_lm_loss = loss_fct(lm_logits.view(-1, self.config.vocab_size), labels.view(-1))
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\torch\nn\modules\loss.py", line 1179, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "D:\environment\Anaconda\envs\Summary\lib\site-packages\torch\nn\functional.py", line 3053, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
ValueError: Expected input batch_size (512) to match target batch_size (1024).
不知道问题出在哪,检查过输入的数据,模型输入和标签是一一对应的。