1. 程式人生 > >keras multi gpu 分散式訓練

keras multi gpu 分散式訓練

可以參考mask rcnn的例子

還有一個教程:Keras同時用多張顯示卡訓練網路  點選開啟連結

''' 根據官方文件
    To save the multi-gpu model, use .save(fname) or .save_weights(fname) with the template model (the argument you
    passed to multi_gpu_model), rather than the model returned by multi_gpu_model.
    或者:自己制定回撥函式儲存: https://www.jianshu.com/p/db0ba022936f
    或者:modelGPU.__setattr__('callback_model',modelCPU)
     #now we can train as normal and the weights saving in our callbacks will be done by the CPU model
     modelGPU.fit_generator( . . .   https://github.com/keras-team/keras/issues/8123
    '''

以及官方部落格:https://keras.io/utils/#multi_gpu_model

如何對keras模型的每一層設定不同的學習率,以及設定不同的偏置的學習率(一般偏置學習率是權值學習率的兩倍) 點選開啟連結 

5 tips for multi-GPU training with Keras 點選開啟連結

Maxing Multiple GPUs of Different Speeds with Keras and TensorFlow 點選開啟連結

[知乎上的理論分析]如何理解深度學習分散式訓練中的large batch size與learning rate的關係? 點選開啟連結

多GPU訓練學習率的調節:點選開啟連結