当前位置:   article > 正文

RuntimeError: cublas runtime error : resource allocation failed at

cublas runtime error : resource allocation failed at /pytorch/aten/src/thc/t

[root@bsyocr server-train]# tail trainall210722_6.log.txt 
  File "/home/server-train/pytorch_pretrained/modeling.py", line 300, in forward
    mixed_query_layer = self.query(hidden_states)
  File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib64/python3.6/site-packages/torch/nn/modules/linear.py", line 87, in forward
    return F.linear(input, self.weight, self.bias)
  File "/usr/local/lib64/python3.6/site-packages/torch/nn/functional.py", line 1371, in linear
    output = input.matmul(weight.t())
RuntimeError: cublas runtime error : resource allocation failed at /pytorch/aten/src/THC/THCGeneral.cpp:216

跑模型时出现RuntimeError: CUDA out of memory.错误 查阅了许多相关内容,原因是:GPU显存内存不够 简单总结一下解决方法: 将batch_size改小

本次修改bert 的pad.size 大小由2048 ->1024 

https://download.csdn.net/download/weixin_38552305/14884908?utm_medium=distribute.pc_relevant.none-task-download-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base&depth_1-utm_source=distribute.pc_relevant.none-task-download-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/89121
推荐阅读
相关标签
  

闽ICP备14008679号