当前位置:   article > 正文

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate XXX

torch.cuda.outofmemoryerror: cuda out of memory. tried to allocate 20.00 mib

问题描述:torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.39 GiB. GPU 0 has a total capacty of 8.00 GiB of which 0 bytes is free. Of the allocated memory 9.50 GiB is allocated by PyTorch, and 2.24 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

解决办法:调小batch或者图片大小

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

闽ICP备14008679号