Skip to content

Instantly share code, notes, and snippets.

@okwrtdsh
Created May 28, 2018 02:43
Show Gist options
  • Save okwrtdsh/6cb4ebf429526f6f2b36b2bbfada6176 to your computer and use it in GitHub Desktop.
Save okwrtdsh/6cb4ebf429526f6f2b36b2bbfada6176 to your computer and use it in GitHub Desktop.

keras(tf backend)でgpuの設定

%matplotlib inline
import tensorflow as tf
from keras import backend as K
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.visible_device_list="0"
sess = tf.Session(config=config)
K.set_session(sess)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment