【分布式训练】单机多卡的正确打开方式:TensorFlow
参考【分布式训练】单机多卡的正确打开方式(二):TensorFlow
样例
# ============================Build Model==========================
mirrored_strategy = tf.distribute.MirroredStrategy()
with mirrored_strategy.scope():
model = WideDeep(feature_columns, hidden_units=hidden_units, dnn_dropout=dnn_dropout)
# model.summary()
# ============================Compile============================
model.compile(loss=binary_crossentropy, optimizer=Adam(learning_rate=learning_rate),
metrics=[AUC()])