Fork me on GitHub

keras failed to create cublas handle:CUBLAS_STATUS_ALLOC_FAILED问题

 

Keras深度学习时报错 failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED
需要添加一下代码到文件中:

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

stackoverflow

posted @ 2019-10-28 22:21  HenryWangg  阅读(323)  评论(0)    收藏  举报