【发布时间】:2020-07-13 08:33:32
【问题描述】:
我一直想增加批量大小以提高模型的泛化能力(它对批量大小非常敏感)。解决方案是使用多 GPU 以利用更多内存。我在我的脚本中使用 tensorflow.keras(在 Windows 10 上使用 tensorflow 2.1),并按照说明为我的模型配置镜像策略。问题是我的训练脚本在没有镜像策略代码的情况下运行得非常好,但是使用镜像策略时,我收到关于 NCCL 的错误。这看起来与以下问题完全相同:
https://github.com/tensorflow/tensorflow/issues/21470
不幸的是,该链接中讨论的解决方案:
cross_tower_ops = tf.contrib.distribute.AllReduceCrossDeviceOps(
'hierarchical_copy', num_packs=num_gpus))
strategy = tf.contrib.distribute.MirroredStrategy(cross_tower_ops=cross_tower_ops)
不适用于 tf 2.1,因为 tf 的“contrib”部分似乎已被删除。 有谁知道 Windows 上 NCCL 的替换修复是什么,或者 tf 的“contrib”部分已经消失了?
【问题讨论】:
-
我实际上没有在 Windows 上。能够让它在 Linux 上运行......但我仍然会喜欢在 Windows 上使用的方法。我在这个问题上开始了赏金,希望这有助于引起人们对这个问题的关注。
标签: python tensorflow