본문 바로가기

D.S/ML&DL

TF2 GPU 메모리 할당 수거 방법 ?

728x90

 

TF2가 메모리 할당을 키우는 건 있어도 의도적으로 해제하는 공식적(?) 방법은 현재로서는 없는 것 같기도..;; 메모리를 다 잡고 있으니까 너무 불편한데. 계속 커널 내렸다 올렸다 해야 하고..

 

참조: https://github.com/tensorflow/tensorflow/issues/36465

 

How can I clear GPU memory in tensorflow 2? · Issue #36465 · tensorflow/tensorflow

System information Custom code; nothing exotic though. Ubuntu 18.04 installed from source (with pip) tensorflow version v2.1.0-rc2-17-ge5bf8de 3.6 CUDA 10.1 Tesla V100, 32GB RAM I created a model, ...

github.com

 

멀티프로세싱을 쓰라고 하는 조언도 있는데 자꾸 CUDA_ERROR_NOT_INITIALIZED: initialization error 가 남...흠;; 현재 TF2 사용중.

 

참조: https://github.com/tensorflow/tensorflow/issues/44137 (이 친구도 나랑 비슷한 상황인듯..??)

 

멀티프로세싱에 끼워쓰라는 조언 (TF1 예시임):

 

 

해결법 아시는 분 댓글 좀 부탁드립니다. 감사합니다.

 

반응형