Last active
July 16, 2017 11:57
-
-
Save ypwhs/bfdc890107cad8e98e48006c37419b7e to your computer and use it in GitHub Desktop.
避免keras占用所有的显存
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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