torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 810.00 MiB
时间: 2023-09-20 09:15:02 浏览: 226
torch.cuda.OutOfMemoryError: CUDA out of memory是指在使用PyTorch进行GPU计算时,出现了内存不足的错误。具体来说,在尝试分配810.00 MiB的内存时,由于已经分配了一部分内存并没有释放,导致了内存不足的情况。
解决这个问题的方法之一是调整max_split_size_mb参数,以避免内存碎片化。这个参数可以在代码中设置,具体的值可以根据情况进行调整。另外,可以查阅PyTorch的内存管理文档以及PYTORCH_CUDA_ALLOC_CONF文档,获取更多关于内存管理和配置的信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [报错记录torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 90.00 MiB (GPU 0; 7.93 ...](https://blog.csdn.net/gongkeguo/article/details/127674524)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [成功解决torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 86.00 MiB (GPU 0; 2.00 ...](https://blog.csdn.net/qq_41185868/article/details/131015210)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文