cuda out of memory (1) 썸네일형 리스트형 [error] GPU가 충분한데 CUDA OUT OF MEMORY가 발생합니다 tensorflow 만 쓰면 문제가 없는데, tensflow 와 pytorch 를 혼합해서 쓰는 경우 발생한다고 한다. tensorflow 는 GPU를 미리 다 할당받은 다음, 사용하는 구조라서 그걸 코드로 방지해야 한다. import tensorflow as tf gpus = tf.config.experimental.list_physical_devices('GPU') if gpus: try: # Currently, memory growth needs to be the same across GPUs for gpu in gpus: tf.config.experimental.set_memory_growth(gpu, True) logical_gpus = tf.config.experimental.list_logi.. 이전 1 다음