[사용환경]
python 3.7.5
transformers 4.32.0
[문제상황]
현재 facebook/wav2vec2-conformer-rope-larges 모델을 저의 데이터로 finetuning 하는 중인데요,
아래와 같은 에러가 발생하였는데 도저히 구글에 검색하거나 코드를 찾아보아도 해결법을 알 수 없어 질문을 올립니다.
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 68 but got size 70 for tensor number 1 in the list.
제 생각엔 padding 문제인 것 같긴합니다만 해결법을 알 수가 없네요 ㅜㅜ
혹시 같은 내용의 오류를 해결하셨던 적이 있으시거나 해결 방법을 아시는 분은 답변 주시면 감사하겠습니다.
[에러내용]
trainer.train()
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer.py", line 1555, in train
return inner_training_loop(
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer.py", line 1929, in _inner_training_loop
self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval)
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer.py", line 2256, in _maybe_log_save_evaluate
metrics = self.evaluate(ignore_keys=ignore_keys_for_eval)
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer.py", line 2972, in evaluate
output = eval_loop(
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer.py", line 3199, in evaluation_loop
preds_host = logits if preds_host is None else nested_concat(preds_host, logits, padding_index=-100)
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer_pt_utils.py", line 122, in nested_concat
return type(tensors)(nested_concat(t, n, padding_index=padding_index) for t, n in zip(tensors, new_tensors))
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer_pt_utils.py", line 122, in
return type(tensors)(nested_concat(t, n, padding_index=padding_index) for t, n in zip(tensors, new_tensors))
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer_pt_utils.py", line 122, in nested_concat
return type(tensors)(nested_concat(t, n, padding_index=padding_index) for t, n in zip(tensors, new_tensors))
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer_pt_utils.py", line 122, in
return type(tensors)(nested_concat(t, n, padding_index=padding_index) for t, n in zip(tensors, new_tensors))
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer_pt_utils.py", line 124, in nested_concat
return torch_pad_and_concatenate(tensors, new_tensors, padding_index=padding_index)
File "/home/jieun/anaconda3/envs/torch/lib/python3.8/site-packages/transformers/trainer_pt_utils.py", line 79, in torch_pad_and_concatenate
aa = torch.cat((tensor1, tensor2), dim=0)
RuntimeError: Sizes of tensors must match except in dimension 0. Expected size 68 but got size 70 for tensor number 1 in the list.