zjunlp / DeepKE

[EMNLP 2022] An Open Toolkit for Knowledge Graph Extraction and Construction
http://deepke.zjukg.cn/
MIT License
3.52k stars 682 forks source link

bert运行出错 #459

Closed HuiGe88 closed 6 months ago

HuiGe88 commented 6 months ago

在使用bert模型运行re任务时出现以下错误:

RuntimeError: CUDA out of memory. Tried to allocate 192.00 MiB (GPU 0; 11.75 GiB total capacity; 9.90 GiB already allocated; 89.25 MiB free; 9.97 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

bert模型使用的是chinese-bert-wwm

zxlzr commented 6 months ago

您好, 您报错是显示显存不足,建议您查看下是否有足够的显存运行然后重试下。

HuiGe88 commented 6 months ago

您好,我的显存是12G的,不满足使用bert实现re任务的配置吗?

zxlzr commented 6 months ago

您好, 您把句子长度设置短一点或者batch size 调小试试看

HuiGe88 commented 6 months ago

请问是在bert.yaml里面将max_seq_length和batch_size调小吗?

zxlzr commented 6 months ago

是的

zxlzr commented 6 months ago

请问您的问题解决了吗?