shibing624 / pycorrector

pycorrector is a toolkit for text error correction. 文本纠错,实现了Kenlm,T5,MacBERT,ChatGLM3,Qwen2.5等模型应用在纠错场景,开箱即用。
https://www.mulanai.com/product/corrector/
Apache License 2.0
5.61k stars 1.1k forks source link

macbert重新训练爆显存 #416

Closed qni2 closed 1 year ago

qni2 commented 1 year ago

你好,我按照readme用提供的数据重新训练macbert想测试模型是否能达到相似精度,在跑到第一个epoch的71%左右会显示爆显存torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 672.00 MiB (GPU 0; 12.00 GiB total capacity; 9.67 GiB already allocated; 0 bytes free; 10.86 GiB reserved in total by PyTorch)。我打算在train_macbert4csc.yml中减少batch_size,但这会影响训练结果吗?或者还可以改动什么地方来解决此问题?谢谢

shibing624 commented 1 year ago

可以减少batch_size。

qni2 commented 1 year ago

谢谢