딥러닝/CUDA
Tensorflow 이용 후 cuDNN 초기화 및 GPU에 garbage메모리 있을 때 처리법
Kaen2891
2018. 4. 12. 16:54
728x90
Machine을 이용 후 CUDA가 초기화가 되지 않거나, 잔여 메모리가 nvidia-smi 할 때 GPU에 남아 있는 현상이 가끔 일어나는데,
아래와 같이 python으로 하나 짜둔 뒤 실행해보면 처리가 된다.
initialized_machine.py
# status initialize
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1' // 초기화할 GPU number
# out of memory
import tensorflow as tf
with tf.Graph().as_default():
gpu_options = tf.GPUOptions(allow_growth=True)
실행 : python3 initialized_machine.py
728x90