eecrazy / ConstructingNEEG_IJCAI_2018

The data and code for our IJCAI-ECAI 2018 paper: Constructing Narrative Event Evolutionary Graph for Script Event Prediction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: CUDA out of memory.

jianzhengming opened this issue · 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.
""

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