Skip to content

Instantly share code, notes, and snippets.

@danyashorokh
Created August 20, 2020 21:40
Show Gist options
  • Save danyashorokh/420ed19d515eb6b6d0a798c14cebb81e to your computer and use it in GitHub Desktop.
Save danyashorokh/420ed19d515eb6b6d0a798c14cebb81e to your computer and use it in GitHub Desktop.
[KERAS] Multi gpu
from keras.utils import multi_gpu_model
from keras import backend as K
print(K.tensorflow_backend._get_available_gpus())
n_gpus = 2
model = get_some_model()
gpu_model = multi_gpu_model(model, gpus=n_gpus)
gpu_model.compile()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment