keras failed to create cublas handle:CUBLAS_STATUS_ALLOC_FAILED問題

Keras深度學習時報錯 failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
需要添加一下代碼到文件中:

from keras.backend.tensorflow_backend import set_session
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True  # dynamically grow the memory used on the GPU
config.log_device_placement = True  # to log device placement (on which device the operation ran)
sess = tf.Session(config=config)
set_session(sess)  # set this TensorFlow session as the default session for Keras
參考

stackoverflow

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章