特牛网址导航

pytroch运行时出现:CUDA error:out of memory_torch.tensor.cpu().detach() torch.cuda.outofmemory-CSDN博客

网友收藏
文章浏览阅读135次。一、验证集评估阶段的张量计算非常占用空间。法1. 可以对利用torch.tensor().detach().cpu().numpy()转为numpy,在cpu上进行loss和acc的计算法2. 直接对评估阶段使用with torch.no_grad():_torch.tensor.cpu().detach() torch.cuda.outofmemoryerror: cuda out of memory