AI编程生活评测

paddle微调训练报错:Unable to create tensor you should probably activate…

编程笔记 / 2023-11-09 / 1 min
在使用paddle进行文档内容提取微调训练时,出现报错。 报错内容:
 "Unable to create tensor, you should probably activate truncation and/or padding "
ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length.

...

OSError: (External) CUDNN error(4), CUDNN_STATUS_INTERNAL_ERROR.
  [Hint: 'CUDNN_STATUS_INTERNAL_ERROR'.  An internal cuDNN operation failed.  ]
直译就是:无法创建张量,然后最终是由CUDNN抛出一个错误。 这个错误,尝试了一些办法,最终发现是显存不够,调小训练参数 batch_size 即可:
--per_device_train_batch_size  8 \
--per_device_eval_batch_size 8 \
点击刷新