1

我有两台机器,机器 1 有 GPU,机器 2 只有一个 CPU。我想知道两台机器是否可以在TensorFlow中使用Multi-worker training,即分布式训练时,machine1使用GPU,machine2使用CPU。

TensorFlow 的版本是 2.1.0

4

2 回答 2

1

您可以使用 Multi-worker 在多台机器上使用 TensorFlow 训练模型。默认情况下,TensorFlow 在你的系统 CPU 上训练模型,但如果你有一个 Nvidia GPU,你可以安装 CUDA,它允许你在 GPU 上训练模型。

于 2020-03-18T03:51:20.387 回答
0

答案是不。当我分发深度学习时,请遵循本教程:

https://www.tensorflow.org/tutorials/distribute/multi_worker_with_keras

发生了一些错误:

tensorflow.python.framework.errors_impl.InternalError: Collective Op CollectiveBcastSend: Broadcast(1) is assigned to device /job:worker/replica:0/task:0/device:GPU:0 with type GPU and group_key 1 但该组有类型 CPU [Op:CollectiveBcastSend]

在我通过代码将 machine1 设置为使用 CPU 之后:

os.environ['CUDA_VISIBLE_DEVICES'] = '-1'

训练将使用两台机器的 CPU 成功运行。

于 2020-03-20T08:53:24.260 回答