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. #16

Open
Yewon-dev opened this issue Mar 5, 2022 · 0 comments
Open

RuntimeError: CUDA out of memory. #16

Yewon-dev opened this issue Mar 5, 2022 · 0 comments

Comments

@Yewon-dev
Copy link
Contributor

Yewon-dev commented Mar 5, 2022

❗️Error Description

  • Error Message
RuntimeError: CUDA out of memory. Tried to allocate 122.00 MiB 
(GPU 0; 3.95 GiB total capacity; 3.08 GiB already allocated; 44.44 MiB free; 280.89 MiB cached)

✔️ Solution Description

Case 1

  • 모델의 output을 다른 함수나 코드에 사용하는 경우, 메모리 반환이 이루어지지 않음 -> output을 복사한 후 사용

Case 2

  • 학습 데이터 및 GPU cache 삭제
del trainData # 학습 데이터 삭제
torch.cuda.empty_cache() # GPU 캐시 데이터 삭제

Case 3

  • batch size 줄이기
    (but, not recommended..)
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

1 participant