Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: CUDA out of memory. #8

Open
jianzhengming opened this issue Oct 29, 2019 · 1 comment
Open

RuntimeError: CUDA out of memory. #8

jianzhengming opened this issue Oct 29, 2019 · 1 comment

Comments

@jianzhengming
Copy link

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.
""

@Red-Flame
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants