title: How to use other GPUs in Keras with a TensorFlow backend?
body: <p>This is related to <a href="https://stackoverflow.com/questions/36992542/how-to-enable-keras-with-theano-to-utilize-multiple-gpus">How to enable Keras with Theano to utilize multiple GPUs</a> but instead of using multiple GPUs, I'm interested in specifying which GPU the specific model trains or runs on.</p>
  
  <p>My <code>nvidia-smi</code> output looks as follows:</p>
  
  <pre><code>+------------------------------------------------------+                       
  | NVIDIA-SMI 361.42     Driver Version: 361.42         |                       
  |-------------------------------+----------------------+----------------------+
  | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
  | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
  |===============================+======================+======================|
  |   0  Tesla K80           Off  | 0000:03:00.0     Off |                    0 |
  | N/A   38C    P0    60W / 149W |  11354MiB / 11519MiB |      0%      Default |
  +-------------------------------+----------------------+----------------------+
  |   1  Tesla K80           Off  | 0000:04:00.0     Off |                    0 |
  | N/A   37C    P0    71W / 149W |    224MiB / 11519MiB |      0%      Default |
  +-------------------------------+----------------------+----------------------+
  |   2  GeForce GTX 750 Ti  Off  | 0000:06:00.0      On |                  N/A |
  | 40%   29C    P8     1W /  38W |    120MiB /  2047MiB |      0%      Default |
  +-------------------------------+----------------------+----------------------+
  </code></pre>
  
  <p>This output is of course when nothing is running. The issue is I'm not sure in Keras how to specify which GPU to run on. Of course, with TensorFlow we can just do the <code>with tf.device('/cpu:1'):</code> paradigm, but I am not sure how that would integrate with Keras.</p>
  
  <p>Thanks!</p>