unet
unet copied to clipboard
How to use GPU to train not CPU
You know,It is extra slowly when using CPU, I wanna train quickly by using GPU. So,could you tell me how to change or add some codes to implement it.Thanks
Use tensorflow-gpu instead of the normal one.
Like Merveydn said, you'll want to load tensorflow-gpu instead of tensorflow.
Additionally, to make a keras model train/use multiple GPU instances instead of the one, first import what you need...
from keras.utils import multi_gpu_model
Then, after you define your model, convert it to use GPUs.
model = Model(input = inputs, output = outputs)
model = multi_gpu_model(model, gpus=8)
Now, in my case I have multiple GPUs to use (8). But if you only have a single GPU to work with, you can just load tensorflow-gpu and operate as normal.
@merveydn hello I use tensorflow-gpu, but it still works in cpu.
@ChengxiHAN do you solve it?
After i change python 3.6.Do the same things, problem solve. Maybe it's because the python2.7 not suitable to keras2.2.
After i change python 3.6.Do the same things, problem solve. Maybe it's because the python2.7 not suitable to keras2.2.
should I use different or same commands as used for running on the CPU? like this (https://github.com/zhixuhao/unet/blob/master/trainUnet.ipynb)