ConstructingNEEG_IJCAI_2018
ConstructingNEEG_IJCAI_2018 copied to clipboard
RuntimeError: CUDA out of memory.
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. ""
问题出在predict_with_minibatch()中,该方法返回了计算图tensor的scores导致未释放存储,可以使用返回scores.detach()解决:
...
accuracy4 = num_correct4 / samples *100.0
scores=scores.detach()
return accuracy0,accuracy1,accuracy2,accuracy3,accuracy4,scores