张量流分布式训练中的噪声损失

时间:2019-09-17 23:17:11

标签: tensorflow distributed-computing

我正在通过estimators API在Tensorflow中进行分布式学习,并且在比较一台机器配置(一台机器和一台主机在同一台机器上)和两台机器配置(一台机器)时,我总是在张量板上低于训练损失图和#1机器上的一位负责人,#2机器上的一位工人)。

enter image description here enter image description here

另外,当我下载图形数据时,我发现在两机分布式培训案例中,有些步骤丢失了。 我的模型是在keras中定义的,我使用标准的估计器函数通过以下格式的数据集API进行分布式训练(read_dataset是具有生成训练或评估数据集的自定义函数):

runConfig = tf.estimator.RunConfig(
        session_config=config,
        model_dir=log_dir,
        save_summary_steps=1,
        save_checkpoints_steps=train_steps
        )
estimator = tf.keras.estimator.model_to_estimator(model, model_dir=log_dir, config=runConfig)
train_spec = tf.estimator.TrainSpec(input_fn=lambda: read_dataset(...), max_steps=...)
eval_spec = tf.estimator.EvalSpec(input_fn=lambda: read_dataset(...), start_delay_secs=1, throttle_secs=1, steps=None)
tf.estimator.train_and_evaluate(estimator, train_spec, eval_spec)

这种嘈杂的行为和缺少日志的原因是什么?

另一个问题:我假设上面的代码实现了数据并行性,其中输入数据集在不同的机器之间分割,因此每个样本在训练期间使用一次,但可能是在不同的机器上使用。是真的吗我正在使用Tensorflow 1.12和1.13。

0 个答案:

没有答案