当前位置:   article > 正文

RuntimeError: CUDA error: out of memory CUDA运行模式问题_return tensor.pin_memory() runtimeerror: cuda erro

return tensor.pin_memory() runtimeerror: cuda error: out of memory cuda kern

【RuntimeError: CUDA error: out of memory.

CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.

For debugging consider passing CUDA_LAUNCH_BLOCKING=1.】CUDA运行模式问题

引入CUDA_LAUNCH_BLOCKING=1
‘’‘程序文件内容开头加入’‘’
import os

os.environ['CUDA_LAUNCH_BLOCKING'] = '1'

  • 1
  • 2
  • 3
  • 4
  • 5
用cpu运行
把.to('cuda')变成.to('cpu')就能获得正常的track
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/220661
推荐阅读
相关标签
  

闽ICP备14008679号