Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- neural net
- pytorch
- abstraction
- deep learning
- elif
- NLP
- Self-loop attention
- Classificaion
- sigmoid
- overfitting
- XOR
- Attention
- sentence embedding
- Set Transformer
- machine learning
- word2vec
- GNN
- Transformer
- Python
- python practice
Archives
- Today
- Total
Research Notes
[Solved] 'RuntimeError: CUDA out of memory.' 본문
- 문제 : 'RuntimeError: CUDA out of memory.' -> 모델이 계산량이 많고, 데이터 배치 사이즈가 커서, 에러가 남.
보통 batch size를 줄이라고 하던데, 8까지 줄여봐도 효과 없었음 (아래 링크 참고)
https://github.com/pytorch/pytorch/issues/16417
RuntimeError: CUDA out of memory. Tried to allocate 12.50 MiB (GPU 0; 10.92 GiB total capacity; 8.57 MiB already allocated; 9.28
CUDA Out of Memory error but CUDA memory is almost empty I am currently training a lightweight model on very large amount of textual data (about 70GiB of text). For that I am using a machine on a c...
github.com
- 해결 : GPU 메모리를 reset 해주는 코드를 에러나는 코드 위에 넣어서 돌림. 배치 사이즈도 줄여줬음!
import gc
gc.collect()
torch.cuda.empty_cache()
'Programming Language > Python' 카테고리의 다른 글
[Solved] IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number (0) | 2022.09.22 |
---|---|
[Python] Virtual Environment Generation Reference (0) | 2022.08.04 |
[Solved] TypeError: an Integer is required (got type bytes) (0) | 2022.04.23 |
[Pytorch] CUDA와 Pytorch 버전 맞추기 (0) | 2022.04.14 |
[Solved] OSError: [WinError 127] 지정된 프로시저를 찾을 수 없습니다 (0) | 2022.04.14 |