keras multi gpu 分布式训练

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaojiajia007/article/details/79268283

可以参考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训练学习率的调节:点击打开链接

猜你喜欢

转载自blog.csdn.net/xiaojiajia007/article/details/79268283