renmada / t5-pegasus-pytorch

401 stars 61 forks source link

使用 t5-pegasus 模型时,损失计算中出现 "RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn" 错误 #71

Closed yudi6 closed 1 year ago

yudi6 commented 1 year ago

使用 PyTorch Lightning 和 T5ForConditionalGeneration 模型加载数据和模型参数后无法进行训练,报错“RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn”。、 Python 版本:3.8 PyTorch 版本:1.13.1 PyTorch Lightning 版本:1.4.9

renmada commented 1 year ago

是怎么解决的,我更新到transformers4.31.0以后也报错

lichengyang666 commented 5 months ago

请问解决了吗