Skip to content

Instantly share code, notes, and snippets.

@ypwhs
Last active July 16, 2017 11:57
Show Gist options
  • Save ypwhs/bfdc890107cad8e98e48006c37419b7e to your computer and use it in GitHub Desktop.
Save ypwhs/bfdc890107cad8e98e48006c37419b7e to your computer and use it in GitHub Desktop.
避免keras占用所有的显存
from keras.backend.tensorflow_backend import set_session
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth=True
set_session(tf.Session(config=config))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment