ConstructingNEEG_IJCAI_2018 icon indicating copy to clipboard operation
ConstructingNEEG_IJCAI_2018 copied to clipboard

RuntimeError: CUDA out of memory.

Open jianzhengming opened this issue 5 years ago • 1 comments

When I run the event_chain.py, I encountered the run time error problem "RuntimeError: CUDA out of memory. Tried to allocate 474.75 MiB (GPU 0; 5.93 GiB total capacity; 4.39 GiB already allocated; 445.06 MiB free; 503.89 MiB cache)" I changed different gpus, e..g., 2080ti, Tesla xp. The same problem still existed. m. ""

jianzhengming avatar Oct 29 '19 03:10 jianzhengming

问题出在predict_with_minibatch()中,该方法返回了计算图tensor的scores导致未释放存储,可以使用返回scores.detach()解决: ... accuracy4 = num_correct4 / samples *100.0 scores=scores.detach() return accuracy0,accuracy1,accuracy2,accuracy3,accuracy4,scores

Red-Flame avatar May 14 '20 16:05 Red-Flame