欢迎光临散文网 会员登陆 & 注册

CUDA error: an illegal memory access

2023-09-12 11:44 作者:blgpb  | 我要投稿

RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. 这个问题困扰了我很久,而且仅仅通过提供的报错信息无法查找到错误的根源。我通过不断地尝试,定位到了问题可能出现的地方。         if attn_bias is not None:             x = x + attn_bias

加上上述代码就会报错,去掉就正常。 改成这样就可以解决问题了。         if attn_bias is not None:             x = x + attn_bias.detach()

CUDA error: an illegal memory access的评论 (共 条)

分享到微博请遵守国家法律