1. keras新版本中加入多GPU并行使用的函数
下面程序段即可实现一个或多个GPU加速:
注意:使用多GPU加速时,Keras版本必须是Keras2.0.9以上版本
from keras.utils.training_utils import multi_gpu_model #导入keras多GPU函数
import VGG19 #导入已经写好的函数模型,例如VGG19
if G <= 1:
print("[INFO] training with 1 GPU...")
model = VGG19()
# otherwise, we are compiling using multiple GPUs
else:
print("[INFO] training with {} GPUs...".format(G))
# we'll store a copy of the model on *every* GPU and then combine
# th

最低0.47元/天 解锁文章
6万+

被折叠的 条评论
为什么被折叠?



