본문 바로가기
연구 노트/R Python

CUBLAS_STATUS_ALLOC_FAILED

by Dr. STEAM 2021. 11. 17.
반응형

에러:

E tensorflow/stream_executor/cuda/cuda_blas.cc:226] failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED

 

해결: 

아래 구문을 통해서 GPU 메모리를 제한해 줘야 된다.

 

config = tf.compat.v1.ConfigProto(gpu_options =

                         tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction=0.8)

# device_count = {'GPU': 1}

)

config.gpu_options.allow_growth = True

session = tf.compat.v1.Session(config=config)

tf.compat.v1.keras.backend.set_session(session)

 

 

 

참고: 

 

python - Tensorflow CUBLAS_STATUS_ALLOC_FAILED error - Stack Overflow

 

728x90
반응형