【分布式训练】单机多卡的正确打开方式: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()])

posted @ 2021-12-18 18:26  麦克斯的园丁  阅读(190)  评论(0编辑  收藏  举报